-
-
Save st0le/0cd46abd215ce9ae55ab6fcfa5788c7c to your computer and use it in GitHub Desktop.
killall cmd for PowerShell with completion
This file contains hidden or 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) } | | |
Sort -Unique Name | | |
Select -ExpandProperty Name | |
} | |
)] | |
$ProcessName) | |
stop-process -Name $ProcessName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment