
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Stop a Windows Service Using PowerShell
To stop specific service using PowerShell, you need to use Stop-Service command.
Syntax
Stop-Service -Name ServiceName Stop-Service -DisplayName ServiceDisplayName
Example
Stop-Service -Name Spooler
To check if service is stopped, type Get-Service -Name Spooler.
Output
Status Name DisplayName ------ ---- ----------- Stopped Spooler Print Spooler
You can also use -Verbose parameter to check the command processes.
PS C:\Windows\system32> Stop-Service -Name spooler -Verbose VERBOSE: Performing the operation "Stop-Service" on target "Print Spooler (spooler)".
You can also perform the stop the service using,
Get-Service -Name Spooler | Stop-Service -Verbose
You can also use the wildcard character (*) to recognize the service and stop it.
For Example,
Stop-Service -Name Spoo* -Verbose
Here, service name starts with “spoo” will be stopped, if there are multiple services starting with spoo, all will be stopped.
Advertisements