public void TestMethod3()
        {
            var config = new PsToolsConfig()
            {
                ExecPath = @"C:\PSTools\PsExec.exe",
                KillPath = @"C:\PSTools\PsKill.exe",
                ToolTimeout = TimeSpan.FromMilliseconds(10000)
            };

            using (var notepad = new PsToolsProcess(Environment.SystemDirectory + "\\notepad.exe", "localhost", config))
            {
                notepad.Start();
                Thread.Sleep(500);
                notepad.Kill();
            }
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PsToolsProcess" /> class.
 /// </summary>
 /// <param name="executablePath">The executable path.</param>
 /// <param name="hostname">The hostname.</param>
 /// <param name="credentials">The credentials.</param>
 /// <param name="config">The configuration for using the PSTools</param>
 /// <param name="disposalAction">The disposal action.</param>
 public PsToolsOwningProcess(string executablePath, string hostname, Credentials credentials, IPsToolsConfig config, Action <IStoppable> disposalAction)
 {
     this.process        = new PsToolsProcess(executablePath, hostname, credentials, config);
     this.disposalAction = disposalAction;
 }