In Powershell, if I type:
install-<tab>
Powershell tab completion will complete with a single command that starts with install-
Install-Package
And I can hit Tab again to see different completions.
Is it possible to have Powershell show all options that start with what I typed, like Linux or Unix shell? Eg, if I type:
install-<tab>
I get:
Install-Package
Install-PackageProvider
Install-Script
PowerShell provides completions on input to provide hints, enable discovery, and speed up input entry. Command names, parameter names, argument values and file paths can all be completed by pressing the Tab key. The Tab key is the default key binding on Windows.
File and cmdlet name completionTo fill in a filename or path from the available choices automatically, type part of the name and press the Tab key. PowerShell will automatically expand the name to the first match that it finds. Pressing the Tab key repeatedly will cycle through all of the available choices.
The TAB key has a specific meaning in PowerShell. It's for command completion. So if you enter "getch" and then type a TAB , it changes what you typed into "GetChildItem" (it corrects the case, even though that's unnecessary).
PSReadLine
has a feature like this called MenuComplete
. Instead of Tab, press Ctrl+space:
You can bind the MenuComplete
function to tab with Set-PSReadLineKeyHandler
:
Set-PSReadlineKeyHandler -Chord Tab -Function MenuComplete
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With