Launching Programs and Keeping in Touch

by Oct 26, 2010

Normally, when you launch a program from inside PowerShell, you will lose contact to it. However, by using Start-Process with the -passthru parameter, you will return the process object, which you can then store and later use to check the execution status, error codes, or even kill the program:

$process = Start-Process notepad.exe -passThru
$process
$process.Kill()

Twitter This Tip!
ReTweet this Tip!