Skip to content

Commit bc55d97

Browse files
authored
Update README.md to cover the use of PSReadLine in PowerShell 6+ (#1034)
1 parent d6b120a commit bc55d97

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# PSReadLine
1313

14-
This module replaces the command line editing experience in PowerShell.exe for versions 3 and up.
14+
This module replaces the command line editing experience of PowerShell for versions 3 and up.
1515
It provides:
1616

1717
* Syntax coloring
@@ -28,27 +28,27 @@ It provides:
2828
* Automatic saving of history, including sharing history across live sessions
2929
* "Menu" completion (somewhat like Intellisense, select completion with arrows) via Ctrl+Space
3030

31-
The "out of box" experience is meant to be very familiar to PowerShell.exe users - there should be no need to learn any new key strokes.
31+
The "out of box" experience is meant to be very familiar to PowerShell users - there should be no need to learn any new key strokes.
3232

33-
Keith Hill wrote a great introduction to PSReadLine [here](http://rkeithhill.wordpress.com/2013/10/18/psreadline-a-better-line-editing-experience-for-the-powershell-console/)
33+
Keith Hill wrote a great introduction to PSReadLine [here](http://rkeithhill.wordpress.com/2013/10/18/psreadline-a-better-line-editing-experience-for-the-powershell-console/).
3434

35-
Ed Wilson (Scripting Guy) wrote a series on PSReadLine, starting [here](http://blogs.technet.com/b/heyscriptingguy/archive/2014/06/16/the-search-for-a-better-powershell-console-experience.aspx)
35+
Ed Wilson (Scripting Guy) wrote a series on PSReadLine, starting [here](http://blogs.technet.com/b/heyscriptingguy/archive/2014/06/16/the-search-for-a-better-powershell-console-experience.aspx).
3636

3737
## Installation
3838

3939
There are multiple ways to install PSReadLine.
4040

4141
### Install from PowerShellGallery (preferred)
4242

43-
You will need PowerShellGet. It is included in Windows 10 and [WMF5](http://go.microsoft.com/fwlink/?LinkId=398175). If you are using PowerShell V3 or V4, you will need to install [PowerShellGet](https://docs.microsoft.com/powershell/gallery/installing-psget).
44-
43+
You will need [PowerShellGet](https://docs.microsoft.com/en-us/powershell/gallery/installing-psget).
4544
After installing PowerShellGet, you can simply run `Install-Module PSReadLine -AllowPrerelease -Force` to get the latest prerelease version.
46-
4745
If you only want to get the latest stable version, run `Install-Module PSReadLine`.
4846

4947
>[!NOTE] Prerelease versions will have newer features and bug fixes, but may also introduce new issues.
5048
51-
If you are on Windows 10, PSReadLine is already installed. Windows 10 RTM and the November update have version 1.1, later builds have version 1.2 (which includes vi mode). See below for how to upgrade.
49+
If you are using Windows PowerShell on Windows 10 or using PowerShell 6+, PSReadLine is already installed.
50+
Windows PowerShell on the latest Windows 10 has version 1.2 of PSReadLine.
51+
PowerShell 6+ versions have the newer prerelease versions of PSReadLine.
5252

5353
### Install from GitHub (deprecated)
5454

@@ -57,9 +57,12 @@ We don't intend to update releases on GitHub, and may remove the release entirel
5757

5858
### Post Installation
5959

60-
Edit your profile to import the module. This step is optional with PowerShell V5 and greater. There are two common profile files commonly used and the instructions are slightly different for each.
60+
If you are using Windows PowerShell V5 or V5.1 versions, or using PowerShell 6+ versions, you are good to go and can skip this section.
6161

62-
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:
62+
Otherwise, you need to edit your profile to import the module.
63+
There are two profile files commonly used and the instructions are slightly different for each.
64+
The file `C:\Users\[User]\Documents\WindowsPowerShell\profile.ps1` is used for all hosts (e.g. the `ISE` and `powershell.exe`).
65+
If you already have this file, then you should add the following:
6366

6467
```powershell
6568
if ($host.Name -eq 'ConsoleHost')
@@ -68,7 +71,7 @@ if ($host.Name -eq 'ConsoleHost')
6871
}
6972
```
7073

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

7376
```powershell
7477
Import-Module PSReadLine
@@ -78,11 +81,19 @@ In either case, you can create the appropriate file if you don't already have on
7881

7982
## Upgrading
8083

81-
When running one of the suggested commands below, be sure to exit all instances of powershell.exe, then run the suggested command from cmd.exe, powershell_ise.exe, or via the Win+R shortcut to make sure PSReadLine isn't loaded.
84+
When running one of the suggested commands below, be sure to exit all instances of `powershell.exe`, `pwsh.exe` or `pwsh`,
85+
then run the suggested command from `cmd.exe`, `powershell_ise.exe`, or via the `Win+R` shortcut to make sure PSReadLine isn't loaded.
86+
87+
If you are using the version of PSReadLine that ships with Windows PowerShell,
88+
you need to run: `powershell -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease"`.
8289

83-
If you are using the version of PSReadLine that ships with Windows 10, you need to run: `powershell -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck"`.
90+
If you are using the version of PSReadLine that ships with PowerShell 6+ versions,
91+
you need to run: `<path-to-pwsh-executable> -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease"`.
8492

85-
If you've installed PSReadLine yourself from the PowerShell Gallery, you can simply run: `powershell -noprofile -command "Update-Module PSReadLine"`.
93+
If you've installed PSReadLine yourself from the PowerShell Gallery,
94+
you can simply run: `powershell -noprofile -command "Update-Module PSReadLine -AllowPrerelease"` or
95+
`<path-to-pwsh-executable> -noprofile -command "Update-Module PSReadLine -AllowPrerelease`,
96+
depending on the version of PowerShell you are using.
8697

8798
If you get an error like:
8899

0 commit comments

Comments
 (0)