0
0
PowerShellscripting~5 mins

Service management (Get/Start/Stop-Service) in PowerShell - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the <code>Get-Service</code> cmdlet do in PowerShell?
It lists all the services on your computer or shows details about a specific service if you provide its name.
Click to reveal answer
beginner
How do you start a service named 'Spooler' using PowerShell?
Use the command Start-Service -Name Spooler to start the 'Spooler' service.
Click to reveal answer
intermediate
What happens if you try to stop a service that is already stopped using Stop-Service?
PowerShell will not throw an error; it simply ensures the service is stopped. If the service is already stopped, nothing changes.
Click to reveal answer
beginner
How can you check the status of a service called 'wuauserv'?
Run Get-Service -Name wuauserv. It shows if the service is Running, Stopped, or Paused.
Click to reveal answer
intermediate
Can you start or stop multiple services at once using PowerShell? How?
Yes, by passing an array of service names to Start-Service or Stop-Service, like Start-Service -Name 'Spooler','wuauserv'.
Click to reveal answer
Which PowerShell cmdlet lists all services on your computer?
AStop-Service
BStart-Service
CGet-Service
DRestart-Service
What does Start-Service -Name 'Spooler' do?
AStarts the Spooler service
BGets the status of the Spooler service
CRestarts the Spooler service
DStops the Spooler service
If you want to stop a service, which cmdlet should you use?
AStop-Service
BGet-Service
CStart-Service
DEnable-Service
How do you check if a service is running or stopped?
AUse <code>Restart-Service</code>
BUse <code>Start-Service</code>
CUse <code>Stop-Service</code>
DUse <code>Get-Service</code>
Can you start multiple services at once in PowerShell?
ANo, only one service at a time
BYes, by listing service names in an array
CYes, but only with <code>Get-Service</code>
DNo, you must use a loop
Explain how to check the status of a service and then start it if it is stopped using PowerShell.
Think about first seeing if the service is stopped, then starting it.
You got /4 concepts.
    Describe how you would stop multiple services at once using PowerShell commands.
    Consider how to pass more than one service name to the cmdlet.
    You got /3 concepts.