3 ms·
I'd suggest the following. get-command add*group* Or for brevity gcm add*group* For reference, the Bash version is this: compgen -c | grep group Edi
by Riverheart 7y ago
I'd suggest the following.
get-command add*group*
Or for brevity
gcm add*group*
For reference, the Bash version is this:
compgen -c | grep group
Edit:
Let's get crazier. You want custom tab completion to focus on the command's noun plus Bash style completion.
$Function:OriginalTabCompletion = $Function:TabExpansion
function TabExpansion($line, $lastWord) {
if ($line -match ('^!(.*)') {
$lastWord = $lastWord.trimstart('!')
Get-command -noun *$lastWord*
} elseif {
OriginalTabExpansion $line $lastWord
}
}
Set-psreadline -chord tab -function MenuComplete
!group<TAB>
- maxxxxx 7y agoOh man. Somebody who really knows PowerShell. That's really rare :-)