Launching PowerShell after Upgrading from PowerShell v7.1.5 to PowerShell v7.2.0 Generates Error
See original GitHub issuePrerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Launching PowerShell after Upgrading from PowerShell v7.1.5 to PowerShell v7.2.0 Generates Error - Could not load type ‘System.Management.Automation.Subsystem.PredictionResult’ from assembly ‘Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.
Expected behavior
Prompt without error.
Actual behavior
Error:
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md
Thank you!
Error details
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md
Thank you!
### Environment
PSReadLine: 2.2.0-beta1
PowerShell: 7.2.0
OS: Microsoft Windows 10.0.22000
BufferWidth: 120
BufferHeight: 9001
Last 0 Keys
Exception
System.TypeLoadException: 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)
### Environment data
```powershell
Unable to run command.
Visuals
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Migrating from Windows PowerShell 5.1 to PowerShell 7
When importing a module by name, PowerShell checks the location specified by $Env:PSModulePath . This allows PowerShell 7 to load both Core and ......
Read more >Installing PowerShell on Windows
The installation commands in this article are for the latest stable release of PowerShell. To install a different version of PowerShell, ...
Read more >Differences between Windows PowerShell 5.1 and ...
This article summarizes the differences and breaking changes from Windows PowerShell 5.1 and the current version of PowerShell that is based ...
Read more >How to upgrade PowerShell version
I run $PSVersionTable and the version installed is 5.1; I run winget search Microsoft.PowerShell and it says that version 7.2 is available as ......
Read more >Microsoft PowerShell 7.3.0 Preview 1 released with many ...
General Cmdlet Updates and Fixes. Update README.md and metadata.json for next preview release; Use PlainText when writing to a host ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This doesn’t work, you’re just reimporting the same PSReadLine module. In place of Step 3, instead of running
Import-Module
, runInstall-Module -Name PSReadLine -RequiredVersion 2.2.0-beta4 -AllowPrerelease
as this explicitly specifies the latest version of PSReadLine to install (At least at the time of writing)After this, it’s safe to import the module again. This is what fixed it for me.
reference : https://www.powershellgallery.com/packages/PSReadLine/2.2.0-beta4
Am I the only one that thinks this is crazy? Why couldn’t the MSI do this automatically?