{"id":19551,"date":"2022-06-27T12:27:46","date_gmt":"2022-06-27T20:27:46","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/powershell\/?p=19551"},"modified":"2022-06-27T12:27:46","modified_gmt":"2022-06-27T20:27:46","slug":"psreadline-2-2-6-enables-predictive-intellisense-by-default","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/psreadline-2-2-6-enables-predictive-intellisense-by-default\/","title":{"rendered":"PSReadLine 2.2.6 enables Predictive Intellisense by default"},"content":{"rendered":"<p>PSReadLine first introduced\n<a href=\"https:\/\/devblogs.microsoft.com\/powershell\/announcing-psreadline-2-1-with-predictive-intellisense\/\">Predictive IntelliSense<\/a>\nusing History based suggestions as a customer enabled feature in November 2020. Since its\nintroduction, two new predictors have become available:<\/p>\n<ul>\n<li>An experimental <a href=\"https:\/\/github.com\/PowerShell\/CompletionPredictor\">PowerShell CompletionPredictor<\/a><\/li>\n<li>The <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/azure-tools-blog\/announcing-general-availability-of-az-tools-predictor\/ba-p\/3297956\">Az.Tools.Predictor<\/a>\nfor Azure PowerShell<\/li>\n<\/ul>\n<p>Today, we are announcing that <strong>PSReadLine 2.2.6<\/strong> enables Predictive IntelliSense by default.<\/p>\n<p>Based on community feedback and successful early releases, customers no longer need to manually\nenable predictions. This release is supported on <strong>Windows PowerShell 5.1<\/strong> and higher.<\/p>\n<h2>Predictions are enabled by default<\/h2>\n<p>Previously, to enable predictions, customers were required to add the following to their\nPowerShell profile:<\/p>\n<pre><code class=\"language-powershell\">Set-PSReadLineOption -PredictionSource HistoryAndPlugin<\/code><\/pre>\n<p>Today, the <strong>PredictionSource<\/strong> is enabled by default as <code>HistoryAndPlugin<\/code> for <strong>PowerShell 7.2<\/strong>\nand higher or <code>History<\/code> downlevel to <strong>Windows PowerShell 5.1<\/strong> . Customers can verify this setting\nusing the following command:<\/p>\n<pre><code class=\"language-powershell\">Get-PSReadLineOption | Select-Object -Property PredictionSource<\/code><\/pre>\n<p>Note &#8211; Plug-ins are only supported in <strong>PowerShell 7.2<\/strong> or higher.<\/p>\n<h2>Installing PSReadLine 2.2.6<\/h2>\n<p>The release is now available for download on the\n<a href=\"https:\/\/www.powershellgallery.com\/packages\/PSReadLine\">PowerShell Gallery<\/a>.<\/p>\n<p>To install <strong>PSReadLine<\/strong>:<\/p>\n<pre><code class=\"language-powershell\">Install-Module -Name PSReadLine<\/code><\/pre>\n<p>To install <strong>PSReadLine<\/strong> using the new\n<a href=\"https:\/\/www.powershellgallery.com\/packages\/PowerShellGet\/3.0.14-beta14\">PowerShellGet.v3<\/a>:<\/p>\n<pre><code class=\"language-powershell\">Install-PSResource -Name PSReadLine<\/code><\/pre>\n<h2>Managing Predictive IntelliSense<\/h2>\n<p>Some customers may prefer to disable Predictive IntelliSense. To change the prediction source, add\nthe <code>Set-PSRedLineOption<\/code> cmdlet to your profile with one of the following values:<\/p>\n<p>To disable all predictions:<\/p>\n<pre><code class=\"language-powershell\">Set-PSReadLineOption -PredictionSource None<\/code><\/pre>\n<p>To only enable history-based suggestions:<\/p>\n<pre><code class=\"language-powershell\">Set-PSReadLineOption -PredictionSource History<\/code><\/pre>\n<p>To only enable additional plugins without history:<\/p>\n<pre><code class=\"language-powershell\">Set-PSReadLineOption -PredictionSource Plugin<\/code><\/pre>\n<h2>Setting the prediction color<\/h2>\n<p>By default, predictions appear in light grey text on the same line the user is typing. To support\naccessibility needs, the prediction color is customizable from the command line or your profile\nscript.<\/p>\n<p>For more information about setting prediction color and other PSReadLine settings, see <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/psreadline\/set-psreadlineoption?view=powershell-7.3\">Set-PSReadLineOption<\/a><\/p>\n<p>Example of setting prediction background color to Blue using <code>$PSStyle<\/code>:<\/p>\n<pre><code class=\"language-powershell\">Set-PSReadLineOption -Colors @{ InlinePrediction = $PSStyle.Background.blue }<\/code><\/pre>\n<p>The default light-grey prediction text color can be restored using:<\/p>\n<pre><code class=\"language-powershell\">Set-PSReadLineOption -Colors @{ InlinePrediction = \"`e[38;5;238m\" }<\/code><\/pre>\n<h2>Future plans<\/h2>\n<p>We value your ideas and feedback for this release. Stop by the\n<a href=\"https:\/\/github.com\/PowerShell\/PSReadLine\/issues\">PSReadLine<\/a> GitHub repository and let us know of\nany issues you find or features you would like added.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Announcing Predictive Intellisense has been proven to be a productivity booster and so we are enabling it by default starting with PSReadLine 2.2.6!<\/p>\n","protected":false},"author":7527,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3168],"class_list":["post-19551","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-psreadline"],"acf":[],"blog_post_summary":"<p>Announcing Predictive Intellisense has been proven to be a productivity booster and so we are enabling it by default starting with PSReadLine 2.2.6!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/7527"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=19551"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19551\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=19551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=19551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=19551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}