【发布时间】:2017-04-07 20:55:51
【问题描述】:
我想杀死一个进程:
$ ps Sourcetree
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
1311 116 136720 137804 57.45 1044 1 SourceTree
$ 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 强制终止进程?
【问题讨论】:
-
stop-process -force? -
@4c74356b41 出于某种原因,我发现的文档不包含 -force,但你是对的 - 将其列为答案(带有指向 msdn.microsoft.com/en-us/powershell/reference/5.1/… 的链接),我会标记它是正确的。
标签: windows powershell process