You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-14Lines changed: 25 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
12
12
# PSReadLine
13
13
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.
15
15
It provides:
16
16
17
17
* Syntax coloring
@@ -28,27 +28,27 @@ It provides:
28
28
* Automatic saving of history, including sharing history across live sessions
29
29
* "Menu" completion (somewhat like Intellisense, select completion with arrows) via Ctrl+Space
30
30
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.
32
32
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/).
34
34
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).
36
36
37
37
## Installation
38
38
39
39
There are multiple ways to install PSReadLine.
40
40
41
41
### Install from PowerShellGallery (preferred)
42
42
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).
45
44
After installing PowerShellGet, you can simply run `Install-Module PSReadLine -AllowPrerelease -Force` to get the latest prerelease version.
46
-
47
45
If you only want to get the latest stable version, run `Install-Module PSReadLine`.
48
46
49
47
>[!NOTE] Prerelease versions will have newer features and bug fixes, but may also introduce new issues.
50
48
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.
52
52
53
53
### Install from GitHub (deprecated)
54
54
@@ -57,9 +57,12 @@ We don't intend to update releases on GitHub, and may remove the release entirel
57
57
58
58
### Post Installation
59
59
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.
61
61
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:
63
66
64
67
```powershell
65
68
if ($host.Name -eq 'ConsoleHost')
@@ -68,7 +71,7 @@ if ($host.Name -eq 'ConsoleHost')
68
71
}
69
72
```
70
73
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:
72
75
73
76
```powershell
74
77
Import-Module PSReadLine
@@ -78,11 +81,19 @@ In either case, you can create the appropriate file if you don't already have on
78
81
79
82
## Upgrading
80
83
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"`.
82
89
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"`.
84
92
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
0 commit comments