/// <summary> /// Executes a program on the remote machine. /// </summary> /// <param name="path">The fully qualified path of the program on the remote machine.</param> /// <param name="args">The arguments to be passed.</param> /// <param name="stdOutput">Will be set to the redirected standard output.</param> /// <param name="stdError">Will be set to the redirected standard error.</param> /// <param name="timeout">The maximum time to wait for the process to complete.</param> /// <returns>The process exit code.</returns> /// <remarks> /// Pass timeout=TimeSpan.Zero to wait forever. /// </remarks> public int Execute(string path, string args, out string stdOutput, out string stdError, TimeSpan timeout) { lock (syncLock) { Verify(); return(remote.Execute(path, args, out stdOutput, out stdError, timeout)); } }