Bash style Tab Completion in PowerShell

Here's how to get Bash style tab completion in PowerShell.

Bash style Tab Completion in PowerShell

I know I often rag on Powershell in favor of Bash. One of the things I really disliked was tab completion. In Bash if you hit tab and you haven't typed out enough of the command to lead to a unique completion, you get asked if you want to view all the potential options and you can select one. If you hit tab in Powershell you just get the first entry in the list of possible matches. That is never what I want.

I was doing something recently that required me to use PowerShell instead of Bash and said "I have to fix this". I little google-fuu took me to https://stackoverflow.com/questions/8264655/how-to-make-powershell-tab-completion-work-like-bash

From there I distilled this wisdom. Open a PowerShell window. Type in the following line. It should open up notepad.

notepade.exe $PROFILE

From there enter the following line in the file it opens and save it.

Set-PSReadLineKeyHandler -Key TAb -Function MenuComplete

Restart Powershell and tab completion should now work like in Bash. This fix makes PowerShell almost usable.