Commands / System

Restart-Service

Restart a Windows service

intermediate System

Restart-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

ShellWhat you might type
bash / zshsudo systemctl restart nginx
cmd.exenet stop Spooler && net start Spooler

More in From bash and From cmd.

Related commands