PSReadLine module: setup and commands
Documentation: Microsoft Learn
Configure command history, prediction, completion and key handlers with PSReadLine while checking host support and avoiding shared-history surprises.
Getting it
Bundled with PowerShell 5.1 and later. Move to the current release with Install-PSResource -Name PSReadLine.
Examples
Show reference output
Show reference output
What it is for
Configure it when interactive work fills a large part of your day, particularly history search and key bindings. It matters for security reviews too, because it writes a plain text history file that can capture whatever was typed at the prompt.
Typical tasks
- Search history with a partial command
- Rebind keys to an editing style you prefer
- Turn on predictive suggestions from history
- Change how the prompt colors errors
- Relocate or shorten the history save file
- Stop sensitive commands from being recorded
Check the installed version
Compare the module path and version with the session used by your scheduled task or automation account. Configure it when interactive work fills a large part of your day, particularly history search and key bindings. It matters for security reviews too, because it writes a plain text history file that can capture whatever was typed at the prompt.