Skip to content

Instantly share code, notes, and snippets.

@ReubenBond
Last active May 20, 2020 18:33
Show Gist options
  • Save ReubenBond/6484d812c76fa413d67f294068c0253c to your computer and use it in GitHub Desktop.
Save ReubenBond/6484d812c76fa413d67f294068c0253c to your computer and use it in GitHub Desktop.
killall cmd for PowerShell with completion
# In a PS terminal, type "code $profile" and put this in there
function killall {
param(
[ArgumentCompleter(
{
param($cmd, $param, $values)
get-process |
? { $_.Name.StartsWith($values, [StringComparison]::OrdinalIgnoreCase) } |
select name -Unique |
% { $_.Name } |
sort
}
)]
$ProcessName)
stop-process -Name $ProcessName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment