PSReadLine
PSReadLine copied to clipboard
Error while launching powershell core
Prerequisites
- [X] Write a descriptive title.
- [X] Make sure you are able to repro it on the latest released version
- [X] Search the existing issues, especially the pinned issues.
Exception report
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.1
OS: Microsoft Windows 10.0.22000
BufferWidth: 269
BufferHeight: 61
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)
### Screenshot
Below is the image that I get while trying to launch Powershell 7

### Environment data
```console
Cannot run this as pwsh shell is not usable
Steps to reproduce
Launch powershell 7 on Windows 11
Expected behavior
Powershell should launch without any exception.
Actual behavior
Powershell launches with exception and is not usable.
This issue was fixed in 2.2.0-beta3 version of PSReadLine. You can fix this by upgrading to the latest 2.2.1-rc1 version of PSReadLine.
To upgrade, simply run Install-Module PSReadLine -AllowPrerelease -Force from your PowerShell console.
If you want to remove that beta version of PSReadLine and use the 2.1.0 version of PSReadLine that's shipped with PowerShell 7.2, you can:
- run
pwsh -noprofile -noninteractiveto startpwshwithout loading PSReadLine - run
Uninstall-Module -Name PSReadLine -RequiredVersion <2.2.0-beta1 or 2.2.0-beta2> -AllowPrereleaseto remove the module. Or, you can manually remove that module folder.