Restart-Service
Restart a Windows service
Restart-Service -Name Spooler -WhatIf
- Works on
- Windows
- PowerShell
- 5.1 and later
- Permissions
- Run as administrator
- Reference
- Microsoft Learn: Restart-Service
Stops a service and starts it again. Needs PowerShell opened as administrator.
The example restarts the Print Spooler, which clears many "stuck print job" problems. Remove -WhatIf to do it for real.
-Name is the short service name. Get-Service -DisplayName '*print*' finds it from the friendly name.
Try this
Get-Service -Name Spooler
Restart-Service -Name Spooler -WhatIf
If other services depend on it, add -Force.
Coming from another shell
| Shell | What you might type |
|---|---|
| bash / zsh | sudo systemctl restart nginx |
| cmd.exe | net stop Spooler && net start Spooler |
More in From bash and From cmd.