Interactively kill process using powershell

199 Views Asked by At

How can an interactive method for killing process in powershell be created?

Kill process preferably in a form using input field to find and kill the processes desired.

1

There are 1 best solutions below

0
skrap3e On BEST ANSWER

This is the best I could come up with

[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