我有我想要的過程殺:如何使用powershell強行殺死一個進程?
$ ps Sourcetree
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
1311 116 136720 137804 57.45 1044 1 SourceTree
把它寄給你Stop-Process
, aka kill
:
$ ps Sourcetree | kill
運行沒有錯誤。但這一過程亦不是被殺:
$ ps Sourcetree
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
1311 116 136720 137804 57.45 1044 1 SourceTree
我如何使用PowerShell強行殺掉一個進程?
'停過程-force'? – 4c74356b41
@ 4c74356b41出於某種原因,我發現文檔不包括-force,但你說得對 - 列表,作爲一個答案(一個鏈接到https://msdn.microsoft.com/en-us/powershell/ reference/5.1/microsoft.powershell.management/stop-process),我將其標記爲正確。 – mikemaccana