在PowerShell中的Stop-Process中,Passthru参数有什么用?
使用Passthru参数,PowerShell在控制台中返回输出。例如,下面的ID12344的notepad.exe进程将停止,并在控制台中显示带有Passthru参数的进程。此前,仅Stop-Process并非如此。
PS C:\WINDOWS\system32> Stop-Process -Id 12344 -PassThru
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
227 13 2800 13440 0.19 12344 1 notepad您还可以组合–Confirm和–PassThru参数。
PS C:\WINDOWS\system32> Stop-Process -Id 26492 -Confirm -PassThru
Confirm
Are you sure you want to perform this action?
Performing the operation "Stop-Process" on target "notepad (26492)".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
228 14 3152 13736 0.20 26492 1 notepad热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短