Monday, September 07, 2009

Get Running/Stopped Services Using PowerShell

Here is a little snippet you can use to get a list of Stopped/Running services on your Windows box color coded by "State" (Running or Stopped)



get-service | sort name |
foreach {
if ( $_.Status -eq "Running")
{ write-host $_.Status $_.Name }
else
{ write-host -foreground RED -background YELLOW $_.Status $_.Name} }

0 comments: