Extension does not pick up PowerShell LTS msix installation

Aperta
#5,691 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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'!

Lingua principale
TypeScript
Stelle
1.9k
Fork
550
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/vscode-powershell

Tutte le issue di PowerShell/vscode-powershell

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.