Windows: PowerShell Store detection throws ENOENT when scanning %LOCALAPPDATA%\Microsoft\WindowsApps
@anthonykim1 is already working on this.
Since Jun 2, 2026.
Assessment
This issue has not been assessed yet.
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.122.1
- Commit: 8761a5560cfd65fdd19ce7e2bd18dab5c0a4d84e
- Date: 2026-05-29T09:25:37+02:00
- OS Version: Windows 10 Pro 21H1, build 19043.1052
Steps to Reproduce:
- Start VS Code on Windows.
- Open the integrated terminal, or trigger terminal profile detection.
- Check the VS Code logs.
Actual result:
VS Code logs the following error:
ERR ENOENT: no such file or directory, scandir 'C:\Users\weisen\AppData\Local\Microsoft\WindowsApps': Error: ENOENT: no such file or directory, scandir 'C:\Users\weisen\AppData\Local\Microsoft\WindowsApps'
at async readdir (node:internal/fs/promises:953:18)
at async P1 (file:///C:/Program%20Files/Microsoft%20VS%20Code/8761a5560c/resources/app/out/main.js:406:97618)
at async Object.ff (file:///C:/Program%20Files/Microsoft%20VS%20Code/8761a5560c/resources/app/out/main.js:406:97484)
at async j0 (file:///C:/Program%20Files/Microsoft%20VS%20Code/8761a5560c/resources/app/out/main.js:446:27483)
at async UL (file:///C:/Program%20Files/Microsoft%20VS%20Code/8761a5560c/resources/app/out/main.js:446:28079)
at async Rw (file:///C:/Program%20Files/Microsoft%20VS%20Code/8761a5560c/resources/app/out/main.js:446:28352)
Expected result:
If %LOCALAPPDATA%\Microsoft\WindowsApps cannot be read during Microsoft Store PowerShell detection, VS Code should ignore that Store PowerShell candidate and continue detecting other available shells, such as Windows PowerShell at:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Additional notes:
The failing code path appears to be Windows PowerShell profile detection. In the minified main.js, j0() checks:
let r = B(process.env.LOCALAPPDATA, "Microsoft", "WindowsApps");
if (!await nr.existsDirectory(r)) return null;
for (let n of await J.readdir(r)) ...
The existsDirectory check is guarded, but the later J.readdir(r) is not. If readdir throws ENOENT, shell detection aborts before falling back to Windows PowerShell.
A local workaround was to wrap the Store PowerShell readdir call in try/catch and return null on failure, allowing the detector to continue to the normal Windows PowerShell fallback.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·