When you launch a program using Start-Process with -passThru, you will get back the process object representing the started program. You can then use this object later to kill the program whenever necessary.
$notepad = Start-Process notepad -passthru
Start-Sleep 2
Stop-Process -inputObject $notepad
ReTweet this Tip!
Posted
Mar 02 2010, 08:00 AM
by
ps1