powershelltab-completion

Can I make powershell tab complete show me all options, rather than picking a specific one?


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

Solution

  • PSReadLine has a feature like this called MenuComplete. Instead of Tab, press Ctrl+<space>:

    EmacsModeTabCompletionWithPSReadLine

    You can bind the MenuComplete function to Tab with Set-PSReadLineKeyHandler:

    Set-PSReadlineKeyHandler -Chord Tab -Function MenuComplete