- Trending Categories
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 the specific instance of the process in PowerShell?
To stop the specific instance of the process, Process ID needs to provide to Stop-Process cmdlet.
Example
In the below example, we need to stop Notepad process with instance ID 25400.
Output
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 228 14 3156 13680 0.13 4900 1 notepad 232 14 3196 13752 0.16 25400 1 notepad
Stop-Process -Id 25400
Now, when Get-Process command is run, there will be no process running with –Id 25400.
Command
PS C:\WINDOWS\system32> Get-Process -Name notepad
Output
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 227 13 2808 13492 0.14 4900 1 notepad
- Related Articles
- How to stop all instances of the process in PowerShell?
- How to get the specific process(es) information using PowerShell?
- What is the use of Passthru parameter in Stop-Process in PowerShell?
- How to check if a process is exited from the system after executing Stop-Process command in PowerShell?
- How to stop the service with the display name in PowerShell?\n
- How to stop the Azure VM using Azure CLI in PowerShell?
- How to get the running processes with the CIM instance using PowerShell?
- How to confirm before stopping the process in PowerShell?
- How to search for the specific service in PowerShell?
- How to stop multiple services using PowerShell?
- How to install the specific version of the PowerShell module version?
- How to copy files of the specific extension using PowerShell?
- How to copy files with the specific extension in PowerShell?
- How to start the specific task of the task scheduler using PowerShell?
- How to update the specific node of the XML file using PowerShell?

Advertisements