public ProcessExecutor(RemoteEnvironment remoteEnvironment, string commandType, string psExecArg, string command,
            string[] args, TimeSpan startTimeout, TimeSpan? executionTimeout = null, bool interactWithDesktop = true)
        {
            _executionTimeout = executionTimeout;
            _remoteEnvironment = remoteEnvironment;

            string arguments = GenerateArguments(psExecArg, command, args, startTimeout, interactWithDesktop);

            _process = new Process
            {
                StartInfo = CreateStartInfo(remoteEnvironment.PsExecPath, arguments)
            };

            _output = new StringBuilder();
            _error = new StringBuilder();

            OsTestLogger.WriteLine("Running " + commandType + "ElevatedCommandInGuest: " +
                                   _process.StartInfo.FileName + " " + _process.StartInfo.Arguments);
            _outputWaitHandle = new AutoResetEvent(false);
            _errorWaitHandle = new AutoResetEvent(false);
            RegisterToEvents();
        }
 public PsExecWrapper(RemoteEnvironment remoteEnvironment)
 {
     _remoteEnvironment = remoteEnvironment;
 }
 /// <summary>
 /// A process running in the guest operating system on a virtual machine.
 /// </summary>
 /// <param name="remoteEnvironment">WindowsShell</param>
 /// <param name="guestPId"></param>
 public RemoteProcess(RemoteEnvironment remoteEnvironment, string guestPId)
 {
     _remoteEnvironment = remoteEnvironment;
       GuestPId = guestPId;
 }