PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Error after installing Powershell 7.2.0

Open plzm opened this issue 5 years ago • 3 comments

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

PowerShell 7.2.0
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Users\p>
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-beta2
PowerShell: 7.2.0
OS: Microsoft Windows 10.0.19043
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)


### Screenshot

![image](https://user-images.githubusercontent.com/35011873/141001463-b5bc8f92-865b-4bfb-818e-3cfddb925dcb.png)


### Environment data

```console
Cannot run the script, as cannot get a functional Powershell prompt anymore.

Steps to reproduce

I had Powershell 7.1.5 installed along with previous versions.

Today downloaded Powershell 7.2.0 x64. Running Windows 10 21H1 19043.1288.

As soon as I opened Windows Terminal got the exception. Opened Terminal both normal and as Adminstrator. Ctrl-C repeated the error, got no prompt where I could run the environment script.

Error also happens in Powershell 7 prompt, same as in Windows Terminal.

Expected behavior

Run 7.2.0 normally.

Actual behavior

The above exception happens.

plzm avatar Nov 09 '21 20:11 plzm

Looks like same issue as #2987

NeilMacMullen avatar Nov 09 '21 20:11 NeilMacMullen

Closing as #2987 is the same.

plzm avatar Nov 09 '21 20:11 plzm

This issue was fixed in 2.2.0-beta3 version of PSReadLine. You can fix this by upgrading to the latest 2.2.0-beta4 version of PSReadLine. Instructions for doing so:

  1. stop all instances of pwsh.
  2. from cmd.exe run: pwsh -noprofile -command "Install-Module PSReadLine -AllowPrerelease -Force"

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:

  1. run pwsh -noprofile -noninteractive to start pwsh without loading PSReadLine
  2. run Uninstall-Module -Name PSReadLine -RequiredVersion <2.2.0-beta1 or 2.2.0-beta2> -AllowPrerelease to remove the module. Or, you can manually remove that module folder.

daxian-dbw avatar Nov 09 '21 21:11 daxian-dbw