How to make PowerShell tab completion work like Bash

It is now possible to get PowerShell to do Bash-style completion, using PSReadline.

Check out blog post Bash-like tab completion in PowerShell.


tab only completes the command name not its previous arguments/parameters.

to also autocomplete the complete command with arguments from history set the below keybinding.

Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward

Now, type few characters of command name and use up/down arrow to autocomplete this command (with arguments) from history.

real time saver.


See more: Power up your PowerShell


New versions of PowerShell include PSReadline, which can be used to do this:

Set-PSReadlineKeyHandler -Key Tab -Function Complete

or, to make it even more like bash where you can use arrow-keys to navigate available options:

Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

To make it permanent, put this command into C:\Users\[User]\Documents\WindowsPowerShell\profile.ps1.