Table of Contents

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

command string
cancellationToken CancellationToken

Returns

Task<SshCommandResult>

Exceptions

SshException

The server refused the command or the connection failed.

InvalidOperationException

The output exceeded MaxCommandOutputBytes.