Created
April 17, 2019 15:48
-
-
Save djhohnstein/89f82ff9eff298f41351ffbe05065b9e to your computer and use it in GitHub Desktop.
Gist to start and stop services in a "fine-grained" manner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$services = Get-Service | % { $_.Name } | |
ForEach($service in $services) | |
{ | |
Write-Host "Stopping $service" | |
sc.exe stop $service | |
Write-Host "Hit any key to start $service" | |
Read-Host | |
sc.exe start $service | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment