在PowerShell中停止进程之前如何确认?
要在停止进程或实例之前获得用户的同意,请使用-confirm参数。
示例
在下面的示例中,我们将使用–Confirm 参数使用–Id4900停止notepad.exe进程。
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"):
同样,您可以使用–Confirm参数使用Name停止该过程。
PS C:\WINDOWS\system32> Stop-Process -Name Notepad -Confirm
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短