Method RunCommandAsync
- Namespace
- SshSharp
- Assembly
- SshSharp.dll
RunCommandAsync(string, CancellationToken)
Runs command on the server and collects its output and exit status.
public Task<SshCommandResult> RunCommandAsync(string command, CancellationToken cancellationToken = default)
Parameters
commandstringcancellationTokenCancellationToken
Returns
Exceptions
- SshException
The server refused the command or the connection failed.
- InvalidOperationException
The output exceeded MaxCommandOutputBytes.