Extension does not pick up PowerShell LTS msix installation

Offen
#5,691 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
tooling

Rechercherichtung

Start from the warning in the logs: the powerShellDefaultVersion setting pointing at a WindowsApps pwsh.exe path is reported as not found, and the extension falls back to Windows PowerShell 5.1. Find where the extension resolves that setting and enumerates installed PowerShell versions, then check whether it handles the MSIX/WindowsApps path and the per-user alias. Reproducing needs a Windows machine with PowerShell LTS 7.6.10 installed via winget. Done when the extension selects that install and the language status stops spinning.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Issue-Bug Needs: Triage
Prerequisites
  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.
Summary

Neither the PowerShell extension nor the integrated terminal with a PowerShell shell picks up the PowerShell LTS msix installation. (7.6.10).

Instead of PowerShell 7, Windows PoweShell 5.1 was picked up.
Then setting the option
"powershell.powerShellDefaultVersion": "C:\\Program Files\\WindowsApps\\Microsoft.PowerShell-LTS_7.6.10.0_x64__8wekyb3d8bbwe\\pwsh.exe" generated the warning message:

2026-11-13 10:31:04.936 [warning] The 'powerShellDefaultVersion' setting was 'C:\Program Files\WindowsApps\Microsoft.PowerShell-LTS_7.6.10.0_x64__8wekyb3d8bbwe\pwsh.exe' but this was not found! Instead using first available installation 'Windows PowerShell (x64)' at 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'!

Setting the option to the per-user alias resulted in the same warning.
The editor language status then keeps on spinning and the powershell extension never returns a prompt.

I checked both
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\Microsoft.PowerShell-LTS_8wekyb3d8bbwe\pwsh.exe" -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion' and
& "$env:ProgramFiles\WindowsApps\Microsoft.PowerShell-LTS_7.6.10.0_x64__8wekyb3d8bbwe\pwsh.exe" -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion'
return the proper version from a terminal.

There seems to be a related problem with powershell profile discovery for Windows Terminal, see https://github.com/microsoft/terminal/issues/20028.

PowerShell Version
Name                           Value
----                           -----
PSVersion                      7.6.10
PSEdition                      Core
GitCommitId                    7.6.10
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : ConsoleHost
Version          : 7.6.10
InstanceId       : 9d7b8d06-8e11-4757-b521-200e7f2677aa
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-GB
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
1.146.0
69047191fc427f2f92828279aae1d90d8eeda7ab
x64
Extension Version
[email protected]
Steps to Reproduce

PowerShell 7.6.9 was automatically updated to 7.7.0.
Uninstalled 7.7 via winget uninstall -- id Microsoft.PowerShell.
Reinstalled PowerShell 7.6.10 via winget install --id Microsoft.PowerShell --version 7.6.10.
This version is installed to $env:ProgramFiles\WindowsApps\Microsoft.PowerShell-LTS_7.6.10.0_x64__8wekyb3d8bbwe with a per-user alias in $env:LOCALAPPDATA\Microsoft\WindowsApps\Microsoft.PowerShell-LTS_8wekyb3d8bbwe.

Start vs code and open any PowerShell file.

Visuals

No response

Logs

2026-11-13 10:31:04.936 [warning] The 'powerShellDefaultVersion' setting was 'C:\Program Files\WindowsApps\Microsoft.PowerShell-LTS_7.6.10.0_x64__8wekyb3d8bbwe\pwsh.exe' but this was not found! Instead using first available installation 'Windows PowerShell (x64)' at 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'!

Vorherrschende Sprache
TypeScript
Sterne
1.9k
Forks
550
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PowerShell/vscode-powershell

Alle Issues in PowerShell/vscode-powershell

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.