{"id":689,"date":"2016-12-27T18:27:15","date_gmt":"2016-12-27T16:27:15","guid":{"rendered":"http:\/\/ersinakyuz.com\/blog\/?p=689"},"modified":"2016-12-27T18:27:15","modified_gmt":"2016-12-27T16:27:15","slug":"listing-windows-services-statuses-with-powershell","status":"publish","type":"post","link":"https:\/\/www.ersinakyuz.com\/?p=689","title":{"rendered":"Listing windows services statuses with Powershell"},"content":{"rendered":"<pre class=\"\">$stopingServices=Get-Service | Where-Object {$_.status -eq \"stoping\"}\r\n$startingServices=Get-Service | Where-Object {$_.status -eq \"starting\"}\r\n$runningServices=Get-Service | Where-Object {$_.status -eq \"running\"}\r\n$stoppedServices=Get-Service | Where-Object {$_.status -eq \"stopped\"}\r\n\r\n\r\nif($startingServices){\r\n Write-Host \"`nStarting Services: $startingServices\"\r\n}\r\nif($stopingServices){\r\n Write-Host \"`nStoping Services: $stopingServices\"\r\n}\r\nif($runningServices){\r\n Write-Host \"`nRunning Services: $runningServices\"\r\n}\r\nif($stoppedServices){\r\n Write-Host \"`nStopped Services: $stoppedServices\"\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$stopingServices=Get-Service | Where-Object {$_.status -eq &#8220;stoping&#8221;} $startingServices=Get-Service | Where-Object {$_.status -eq &#8220;starting&#8221;} $runningServices=Get-Service | Where-Object {$_.status -eq &#8220;running&#8221;} $stoppedServices=Get-Service | Where-Object {$_.status -eq &#8220;stopped&#8221;} if($startingServices){ Write-Host &#8220;`nStarting Services: $startingServices&#8221; } if($stopingServices){ Write-Host &#8220;`nStoping Services: $stopingServices&#8221; } if($runningServices){ Write-Host &#8220;`nRunning Services: $runningServices&#8221; } if($stoppedServices){ Write-Host &#8220;`nStopped Services: $stoppedServices&#8221; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[23],"class_list":["post-689","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-powershell"],"_links":{"self":[{"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=\/wp\/v2\/posts\/689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=689"}],"version-history":[{"count":1,"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=\/wp\/v2\/posts\/689\/revisions"}],"predecessor-version":[{"id":690,"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=\/wp\/v2\/posts\/689\/revisions\/690"}],"wp:attachment":[{"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ersinakyuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}