PowerShell 7.2.0 - Could not load type System.Management.Automation.Subsystem.PredictionResult
My PowerShell upgraded to the new PowerShell 7.2.0 and it happened automatically since I get PowerShell from the Windows Store. However, my fancy prompt use PSReadLine with Predictive Autocomplete stopped working suddenly.
However, suddenly I started getting this error on every prompt.
Could not load type 'System.Management.Automation.Subsystem.PredictionResult' from assembly 'Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at Microsoft.PowerShell.PSConsoleReadLine.PredictionViewBase.Reset()
at Microsoft.PowerShell.PSConsoleReadLine.PredictionInlineView.Reset()
at Microsoft.PowerShell.PSConsoleReadLine.Prediction.Reset()
at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
Well, you can see I'm using a Beta of PSReadLine 2.2:
### Environment
PSReadLine: 2.2.0-beta2
PowerShell: 7.2.0
But I have failed to keep it up to date, and when I got into this state, I realized just because my prompt wasn't pretty (momentarily) I could update it with one line while still staying on the Beta Train.
Install-Module PSReadLine -AllowPrerelease -Force
Now I'm on 2.2.0-beta4 and all is well and I have my cool prediction history back!
Sponsor: Couchbase Capella DBaaS is flexible, full-featured and fully managed with built-in access via K/V, SQL and full text search. It’s blazing fast, yet surprisingly affordable. Try Capella today for free.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Install-Package: Administrator rights are required to install or update. Log on to the computer with an account that has Administrator rights, and then try again, or install by adding "-Scope
CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated rights (Run as Administrator).
Install-Module PSReadLine -AllowPrerelease -Force -Scope CurrentUser
1. Remove your PowerShell profile file from `C:\Users\<user>\Documents\PowerShell\
2. Run `Install-Module PSReadLine -AllowPrerelease -Force -Scope CurrentUser` in an Administrator PowerShell instance
3. Reinstate your PowerShell profile
4. Viola!
You may need a higher version of powershellGet:
1. Install-Module -Name PowerShellGet -Force
2. Exit the powershell and reopen it
3. Install-Module PSReadLine -AllowPrerelease -Force
Source: https://github.com/PowerShell/PSReadLine
This Is To Provide General Knowledge About the Body weight and Tips to decrese the weight.
Stay Fit and healthy.Weight Loss
Comments are closed.
pwsh.exe -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease"