- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to stop all instances of the process in PowerShell?
To stop running all the instances of the process in PowerShell Stop-Process command is used. For example, in the below example, we have two running instances of notepad.exe process.
Command
PS C:\WINDOWS\system32> Get-Process notepad
Output
PS C:\WINDOWS\system32> Get-Process notepad Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 228 13 3160 13448 0.14 15564 1 notepad 228 14 3148 13668 0.17 22644 1 notepad
To stop all the instances of the running process, below command will be used.
Stop-Process -Name notepad
You can also pipeline the Stop-Process to end the process.
Get-Process -Name notepad | Stop-Process
To stop multiple processes, provide different process names separated by comma (,)
Get-Process SkypeApp,notepad |Stop-Process -Confirm:$false
Advertisements