While executing commands in PowerShell it’s automatically suggesting texts
How can I disable these suggestions and also in future if I want to enable the suggestions how can I do it?
>Solution :
Use the Set-PSReadLineOption cmdlet:
To disable all suggestions:
Set-PSReadLineOption -PredictionSource None
Enabling offers several options, depending on what source(s) should be used for completions: History, Plugin, or HistoryAndPlugin (the default).
See this blog post for details.
Note:
-
Perhaps surprisingly, the cmdlets that configure the behavior of the
PSReadLinemodule, such asSet-PSReadLineOption, do not do so persistently – they only affect the session at hand. -
Therefore, in order to make (what are effectively) persistent configuration changes, place the command above in your
$PROFILEfile.-
Note: Said file and its parent directory do not exist by default.
-
To create it on demand, use the following command:
if (-not (Test-Path $PROFILE)) { $null = New-Item -Force $PROFILE }
-
