SshCommand BeginExecute Method SSH .NET Client Library Documentation
Begins an asynchronous command execution.

Namespace: Renci.SshNet
Assembly: Renci.SshNet (in Renci.SshNet.dll) Version: 0.1.0.0 (1.0.0.0)
Syntax

public IAsyncResult BeginExecute()

Return Value

An OnlineIAsyncResult that represents the asynchronous command execution, which could still be pending.
Exceptions

Examples

client.Connect();

var cmd = client.CreateCommand("sleep 15s;echo 123"); // Perform long running task 

var asynch = cmd.BeginExecute();

while (!asynch.IsCompleted)
{
    //  Waiting for command to complete...
    Thread.Sleep(2000);
}
result = cmd.EndExecute(asynch);
client.Disconnect();
See Also