Stop-Service
Stop a Windows service
Stop-Service -Name Spooler -WhatIf
- Works on
- Windows
- PowerShell
- 5.1 and later
- Permissions
- Run as administrator
- Reference
- Microsoft Learn: Stop-Service
Careful: Stopping a service other processes depend on will hurt. Use -WhatIf.
-Force also stops dependents. That is a sharp edge. Look at dependents first: Get-Service -Name Spooler | Select-Object -ExpandProperty DependentServices.
Try this
Stop-Service -Name Spooler -WhatIf
Coming from another shell
| Shell | What you might type |
|---|---|
| bash / zsh | sudo systemctl stop nginx |
| cmd.exe | net stop Spooler |
More in From bash and From cmd.