question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Launching PowerShell after Upgrading from PowerShell v7.1.5 to PowerShell v7.2.0 Generates Error

See original GitHub issue

Prerequisites

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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Shigbeardcommented, Nov 12, 2021
1. Open an Powershell session in Administrator privilege

2. Run `Remove-Module PSReadLine` to remove the auto-loaded PSReadLine module.

3. Run `Import-Module PSReadLine` (use PSReadLine with capital L)

4. Then run `Update-Help -Module PSReadLine -Force`

source : https://devblogs.microsoft.com/powershell/updating-help-for-the-psreadline-module-in-windows-powershell-5-1/

This doesn’t work, you’re just reimporting the same PSReadLine module. In place of Step 3, instead of running Import-Module, run Install-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

0reactions
ghostcommented, Mar 17, 2022

Am I the only one that thinks this is crazy? Why couldn’t the MSI do this automatically?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found