PSReadLine 2.2.6 enables Predictive Intellisense by default

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:

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 HistoryAndPlugin

Today, 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 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 the
PowerShell Gallery.

To install PSReadLine:

Install-Module -Name PSReadLine

To install PSReadLine using the new

Install-PSResource -Name PSReadLine

Managing 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 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 support
accessibility needs, the prediction color is customizable from the command line or your profile

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 = $ }

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.


This article was originally published by Microsoft's PowerShell Blog. You can find the original article here.