Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to confirm before stopping the process in PowerShell?
To get the consent from the user before stopping process or instance, -confirm parameter is used.
Example
In the below example, we will stop notepad.exe process with –Id 4900 using –Confirm parameter.
PS C:\WINDOWS\system32> Stop-Process -Id 4900 -Confirm Confirm Are you sure you want to perform this action? Performing the operation "Stop-Process" on target "notepad (4900)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
Similarly, you can use the –Confirm parameter for stopping the process with Name.
PS C:\WINDOWS\system32> Stop-Process -Name Notepad -Confirm
Advertisements
