Skip to content

Instantly share code, notes, and snippets.

@ofhouse
Last active December 27, 2019 15:47
Show Gist options
  • Save ofhouse/fb7e7ef7dd91f4cde044c3165055b590 to your computer and use it in GitHub Desktop.
Save ofhouse/fb7e7ef7dd91f4cde044c3165055b590 to your computer and use it in GitHub Desktop.
PowerShell bash-like autocomplete

Add bash-like autocomplete to PowerShell

  1. Add or open your PowerShell profile (to make the changes permanent)
ii $PROFILE.CurrentUserAllHosts
  1. Add the following lines
# Tab autocomplete
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# Arrow-key autocomplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment