Last active
May 20, 2020 18:33
-
-
Save ReubenBond/6484d812c76fa413d67f294068c0253c to your computer and use it in GitHub Desktop.
killall cmd for PowerShell with completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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