Wednesday, January 02, 2013

Powershell Quick Tips: Kill a process

Stop-Process -ProcessName "notepad"

Where notepad is the name of the process to kill. Or to make life more difficult, you can:

[System.Diagnostics.Process]::GetProcessesByName("notepad") | ForEach-Object {$_.Kill()}

References:
http://technet.microsoft.com/en-us/library/ee177004.aspx

No comments: