PowerShell: PSReadLine Module

The PSReadLine PowerShell module is a god-send in the world of the PowerShell console host. The console host (powershell.exe) has gotten a lot of flak, over the years, for lacking functionality that most non-Windows users are accustomed to having. Some of the enhancements that you get out-of-box with PSReadLine include:

  • Select text with keyboard SHIFT + ARROW KEYS
  • Cut/copy/paste text standard keyboard shortcuts CTRL + X, CTRL + C, CTRL + V
  • Undo / redo standard keyboard shortcuts CTRL + Z and CTRL + Y
  • Enhanced auto-completion for command names, parameter names, and parameter values CTRL + SPACE
  • Searchable command history CTRL + R
  • Clear the console CTRL + L

Animated GIF Example: PowerShell PSReadLine

Here’s an animated GIF with a quick demonstration of a couple basic features, including auto-completion of command names, parameter names, and parameter values, and cutting and pasting text in the PowerShell console host.

PowerShell PSReadLine Demo
PSReadLine Demo

YouTube Video: PowerShell PSReadLine

I’ve also created an introductory video that should help you get started with PSReadLine on Windows 10. I encourage you to spend a little extra time getting used to the keyboard shortcuts that PSReadLine offers, as you will certainly become a more productive developer! Although most people who are used to the Windows command line don’t enjoy text editing in the command line, PSReadLine makes the experience significantly better! Admittedly, it will take a little bit longer for you to spend time memorizing keyboard shortcuts, but the beautiful thing is that most of the PSReadLine keyboard shortcuts are consistent with most other text editors!

Other PowerShell Modules

There are lots of other useful PowerShell modules available, including another one by Jason Shirk at Microsoft called TabExpansion++. We will take a closer look at this module in another post. Don’t forget that, if you upgrade to PowerShell version 5.0, you can get access to the PowerShell Gallery, where you can search for and install PowerShell modules!

Thanks for reading, and come back soon!