$stopingServices=Get-Service | Where-Object {$_.status -eq "stoping"} $startingServices=Get-Service | Where-Object {$_.status -eq "starting"} $runningServices=Get-Service | Where-Object {$_.status -eq "running"} $stoppedServices=Get-Service | Where-Object {$_.status -eq "stopped"} if($startingServices){ Write-Host "`nStarting Services: $startingServices" } if($stopingServices){ Write-Host "`nStoping Services: $stopingServices" } if($runningServices){ Write-Host "`nRunning Services: $runningServices" } if($stoppedServices){ Write-Host "`nStopped Services: $stoppedServices" }
Tags: powershell