PSReadLine 2.2.6 enables Predictive Intellisense by default
PSReadLine first introducedPredictive IntelliSenseusing History based suggestions as a customer enabled feature in November 2020. Since itsintroduction, two new predictors have become available:
- An experimental PowerShell CompletionPredictor
- The Az.Tools.Predictorfor Azure PowerShell
Today, we are announcing that PSReadLine 2.2.6 enables Predictive IntelliSense by default.
Based on community feedback and successful early releases, customers no longer need to manuallyenable predictions. This release is supported on Windows PowerShell 5.1 and higher.
Predictions are enabled by default
Previously, to enable predictions, customers were required to add the following to theirPowerShell profile:
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Today, the PredictionSource is enabled by default as HistoryAndPlugin
for PowerShell 7.2and higher or History
downlevel to Windows PowerShell 5.1 . Customers can verify this settingusing the following command:
Get-PSReadLineOption | Select-Object -Property PredictionSource
Note – Plug-ins are only supported in PowerShell 7.2 or higher.
Installing PSReadLine 2.2.6
The release is now available for download on thePowerShell Gallery.
To install PSReadLine:
Install-Module -Name PSReadLine
To install PSReadLine using the newPowerShellGet.v3:
Install-PSResource -Name PSReadLine
Managing Predictive IntelliSense
Some customers may prefer to disable Predictive IntelliSense. To change the prediction source, addthe Set-PSRedLineOption
cmdlet to your profile with one of the following values:
To disable all predictions:
Set-PSReadLineOption -PredictionSource None
To only enable history-based suggestions:
Set-PSReadLineOption -PredictionSource History
To only enable additional plugins without history:
Set-PSReadLineOption -PredictionSource Plugin
Setting the prediction color
By default, predictions appear in light grey text on the same line the user is typing. To supportaccessibility needs, the prediction color is customizable from the command line or your profilescript.
For more information about setting prediction color and other PSReadLine settings, see Set-PSReadLineOption
Example of setting prediction background color to Blue using $PSStyle
:
Set-PSReadLineOption -Colors @{ InlinePrediction = $PSStyle.Background.blue }
The default light-grey prediction text color can be restored using:
Set-PSReadLineOption -Colors @{ InlinePrediction = "`e[38;5;238m" }
Future plans
We value your ideas and feedback for this release. Stop by thePSReadLine GitHub repository and let us know ofany issues you find or features you would like added.
3 comments
That’s good update, thank you guys
This is awesome! Thanks, Jason and PowerShell team.
Yes thank you guys very much