Psreadline


Image at bottom does not work!!


This module replaces the command line editing experience in PowerShell.exe for versions 3 and up. It provides:

Installation

You will need PowerShellGet. It is included in Windows 10 and WMF5. If you are using PowerShell V3 or V4, you will need to install PowerShellGet.

(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex

After installing PowerShellGet, you can simply run

install-module PsReadLine

Edit your powershell profile. The file C:\Users\[User]\Documents\WindowsPowerShell\profile.ps1 is used for all hosts (e.g. the ISE and powershell.exe). If you already have this file, then you should add the following:

if ($host.Name -eq 'ConsoleHost')
{
 Import-Module PSReadline
}

Alternatively, the file C:\Users\[User]\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 is for powershell.exe only. Using this file, you can simply add:

Import-Module PSReadLine

Usage

Preview current key bindings Ctrl + Alt + Shift + /

Get-PSReadlineKeyHandler

Handy shortcuts

Shortcut Description
Ctrl + Left / Right Navigate trough words
Ctrl + Shift + Left / Right Select words
Ctrl + Home Delete from cursor to beginning of line
Ctrl + End Delete from cursor to end of line
Ctrl + A Select all
Ctrl + C Copy
Ctrl + X Cut
Ctrl + Y / Z Redo / Undo (changes)
Ctrl + L Clear screen

Command completion

Command completion with Ctrl + Space

![alt text](/image.png"Hover text") This is an image

microsoft/powershell/commands/psreadline/