Stopping Every Instance of PowerShell.exe (except the one I'm in)

Our Test Architect just dropped by my office and pitched me a PowerShell question with a nice, quick answer. He wanted to stop every process of a particular name, except for the instance that was running the script. You can do this in one nice pipeline: Get-Process Powershell  | Where-Object { $_.ID -ne $pid } | Stop-Process Get-Process takes a positional parameter (name), which is a wildcard Read More...

Read the complete post at http://blogs.msdn.com/powershell/archive/2009/02/12/stopping-every-instance-of-powershell-exe-except-the-one-i-m-in.aspx


Posted Feb 11 2009, 08:17 PM by Windows PowerShell Blog
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.