使用 powershell 交互式终止进程

Interactively kill process using powershell

如何创建powershell交互杀进程的方法?

最好在表单中使用输入字段查找和终止所需的进程来终止进程。

这是我能想到的最好的办法

[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$killme = [Microsoft.VisualBasic.Interaction]::InputBox('Enter complete or portion of process name', 'Process Name', "")


Get-Process  | Where-Object ProcessName -Like "*$killme*" | kill -confirm -Force -PassThru