PSReadLine first introduced
Predictive IntelliSense
using History based suggestions as a customer enabled feature in November 2020. Since its
introduction, two new predictors have become available:
- An experimental PowerShell CompletionPredictor
- The Az.Tools.Predictor
for 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 manually
enable 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 their
PowerShell profile:
Set-PSReadLineOption -PredictionSource HistoryAndPluginToday, the PredictionSource is enabled by default as HistoryAndPlugin for PowerShell 7.2
and higher or History downlevel to Windows PowerShell 5.1 . Customers can verify this setting
using the following command:
Get-PSReadLineOption | Select-Object -Property PredictionSourceNote – Plug-ins are only supported in PowerShell 7.2 or higher.
Installing PSReadLine 2.2.6
The release is now available for download on the
PowerShell Gallery.
To install PSReadLine:
Install-Module -Name PSReadLineTo install PSReadLine using the new
PowerShellGet.v3:
Install-PSResource -Name PSReadLineManaging Predictive IntelliSense
Some customers may prefer to disable Predictive IntelliSense. To change the prediction source, add
the Set-PSRedLineOption cmdlet to your profile with one of the following values:
To disable all predictions:
Set-PSReadLineOption -PredictionSource NoneTo only enable history-based suggestions:
Set-PSReadLineOption -PredictionSource HistoryTo only enable additional plugins without history:
Set-PSReadLineOption -PredictionSource PluginSetting the prediction color
By default, predictions appear in light grey text on the same line the user is typing. To support
accessibility needs, the prediction color is customizable from the command line or your profile
script.
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 the
PSReadLine GitHub repository and let us know of
any issues you find or features you would like added.
The post PSReadLine 2.2.6 enables Predictive Intellisense by default appeared first on PowerShell Team.
