Vscode-powershell: VS Code + PowerShell 7 from the Store Broken

Created on 31 May 2021  路  11Comments  路  Source: PowerShell/vscode-powershell

Issue Description

I am experiencing a problem with I'm guessing the PowerShell 7 Store.

After seeing the results in the video below, I upgraded psreadline, EditorServicesCommandSuite, I even deleted them from my system entirely from my system then reinstalled the extension so perhaps it's the versions within the extension.

I've installed/reinstalled/uninstalled powershell 7 as well as the extensions and the required modules.

This breaks on all modules.

Attached Logs

Attached
logs.zip

https://user-images.githubusercontent.com/8278033/120157551-6e7f9200-c1f3-11eb-86f2-4503477b048f.mp4

Environment Information

Visual Studio Code

| Name | Version |
| --- | --- |
| Operating System | Windows_NT x64 10.0.19041 |
| VSCode | 1.56.2|
| PowerShell Extension Version | 2021.5.0 |

PowerShell Information

|Name|Value|
|---|---|
|PSVersion|7.1.3|
|PSEdition|Core|
|GitCommitId|7.1.3|
|OS|Microsoft Windows 10.0.19041|
|Platform|Win32NT|
|PSCompatibleVersions|1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0 7.1.3|
|PSRemotingProtocolVersion|2.3|
|SerializationVersion|1.1.0.1|
|WSManStackVersion|3.0|

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)

|Extension|Author|Version|
|---|---|---|
|bracket-pair-colorizer|CoenraadS|1.0.61|
|code-settings-sync|Shan|3.4.3|
|powershell-preview|ms-vscode|2021.5.0|
|remote-containers|ms-vscode-remote|0.177.2|
|remote-ssh|ms-vscode-remote|0.65.4|
|remote-ssh-edit|ms-vscode-remote|0.65.6|
|remote-wsl|ms-vscode-remote|0.56.3|
|search|dbatools|1.1.3|
|vscode-docker|ms-azuretools|1.13.0|
|vscode-github-actions|cschleiden|0.17.0|
|vscode-icons|vscode-icons-team|11.4.0|
|vscode-pull-request-github|GitHub|0.26.0|
|vscode-theme-1984|juanmnl|0.3.4|
|vscode-yaml|redhat|0.19.2|
|wordcount|ms-vscode|0.1.0|

Area-PSReadLine Needs PowerShell-Bug Resolution-External

All 11 comments

This is due to your machine having an incompatible version of PSReadLine 2.2.0-beta2. It is curious, as far as I'm aware that issue should only occur with the latest PowerShell 7 _preview_ 7.2.0-preview.6 and you look like you have 7.1.3, but the stack trace is identical to the problem reported in #3385. Please revert PSReadLine to 2.1.0 (either just uninstall PSReadLine and let the extension use its bundled version instead, or manually revert or even upgrade to beta3).

@rjmholt Can you help me confirm this? The store release is 7.1.3, which I would have _thought_ was compatible with PSReadLine 2.2.0-beta2, but I mean check that stack trace as it flies by in the GIF.

It's definitely in the prediction part of PSReadLine, which suggests that it's related to that.

I downloaded that GIF and stepped through it frame by frame, it is the _same_ stack trace.

Ok we have a plan: to avoid incompatibility issues such as this and #3385 we are going to patch PowerShellEditorServices to _only_ load our bundled version of PSReadLine.

@daxian-dbw this is such a strange issue, it's the exact same stack trace caused by the incompatibility issue, but it's with 7.1.3; @rjmholt thinks he may know what's going on.

2.2.0-beta2 version of PSReadLine shouldn't have this issue with 7.1.x because the affected bits only kick in when the .NET version is >= 6, while 7.1.x uses .NET 5. The logs show the path to the pwsh.exe but not the version of the powershell:

C:\Users\ctrlb\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe

This path looks like installed from Windows Store, and it's likely 7.2.0-preview.6

Hey @potatoqualitee are you perhaps using "PowerShell Preview" in the store?

So ok, this is strange, but for some reason 2.2.0 is being bundled alongside 2.1.0.

Going to leave this closed in favor of #3387, the task to fix the build. The latest stable release is patched and _only contains_ PSReadLine 2.1.0, effectively avoiding this problem.

@andschwa I think I was using the PS Preview but then uninstalled it and went with the stable version and both were broken. Seems like you have the solution though, thank you!

Was this page helpful?
0 / 5 - 0 ratings