Win11 26H2: user PATH (~3.6k) not applied to new processes — winget missing in cmd/PS 5.1/pwsh
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 活躍
- 技術堆疊
- cpp, powershell
- 領域
- cli, operating-systems
研究方向
The report points to Windows environment handling and the winget PATH behavior, but names no source files, tests, or specific component that owns the missing user PATH merge. Start by checking whether this is an operating system behavior outside winget-cli's control, then trace how winget appends package paths. Done would require an agreed scope and a reproducible fix or documentation change covering the reported PATH limit.
由索引模型根據 Issue 內容生成。
描述
After a recent Windows 11 26H2 upgrade, new shells stop loading the user PATH from the registry, so winget and other user-scoped tools vanish from cmd, PowerShell 5.1, and PowerShell 7 even though App Installer and winget.exe are still installed.
Environment
- OS: Windows 11 26H2 (build 10.0.26300)
- App Installer / winget: Microsoft.DesktopAppInstaller 1.29.380 (package status OK)
winget.exeat%LOCALAPPDATA%\Microsoft\WindowsApps\winget.exeruns when invoked by full path (winget --version→ v1.29.380)- User
PATHin registry (HKCUEnvironment\Path): ~3,632 characters, includes%LOCALAPPDATA%\Microsoft\WindowsAppsand 13...\Microsoft\WinGet\Packages\...entries (typical winget portable install pattern without Developer Mode / admin Links layout)
Steps to reproduce
- Accumulate a large user
PATH(common with multiple winget portable/zip packages that each append a longWinGet\Packages\...segment). - Upgrade to Windows 11 26H2 (or open a new cmd / PowerShell 5.1 / pwsh session after upgrade).
- Run
where wingetin cmd orGet-Command wingetin PowerShell 5.1 or pwsh. - Compare
[Environment]::GetEnvironmentVariable('Path','User')(registry) vs$env:Pathin the same process.
Expected
- User
PATHfrom HKCU is merged into every new interactive shell (cmd, PowerShell 5.1, pwsh). wingetresolves via the App Execution Alias underWindowsAppswhen App Installer is installed.- If a platform limit applies, Windows should surface a clear error or warning when user
PATHcannot be applied — not silently drop the entire user block.
Actual
- Registry user
PATHlength ~3632; processPATHlength ~1326 (matches machine PATH only — user PATH not applied at all). where wingetin cmd: not found.Get-Command wingetin PowerShell 5.1 and pwsh: not found.- Direct invocation still works:
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\winget.exe" --version. - PowerShell profile import of
Microsoft.WinGet.CommandNotFoundfails at startup becauseValidateOS.psm1requiresGet-Command wingetto succeed.
Related
- winget-cli #3601 — PATH bloat from portable installs
- winget-cli #5557 — repeated WinGet package PATH entries vs 2047 limit
- winget troubleshooting: missing
%LOCALAPPDATA%\Microsoft\WindowsAppsin PATH (docs)
Ask
- OS: Fix or document behavior when user
PATHexceeds legacy limits — do not silently omit the entire user PATH from new processes. - winget: Default to Links/symlink layout where possible; warn when appending another
Packages\...segment would exceed safe PATH size; offer cleanup for duplicate or stale entries. - Visibility: A high-signal diagnostic (e.g.
winget doctoror Settings) when App Execution Aliases exist but PATH was not applied.
Workaround (local)
- Shorten HKCU
PATH(dedupe, remove per-package WinGet paths, keepWinGet\Links+WindowsApps) and sign out / reboot. turso config set autoupdate off-style:wingetonly via full path until PATH is repaired.
- 主要語言
- C++
- 星號
- 26.6k
- 分支
- 1.8k
- 平均合併
- 3 天 10 小時
- 30 天內合併 PR
- 41
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/winget-cli 的其他 Issue
-
Issue-Docs Needs-Triage
難度 2/5 1-3 小時 新手友好度 70/100
microsoft/winget-cli#6692 ·
維護者通常 2 天內回覆
-
Issue-Docs Possible-Duplicate
難度 2/5 1-3 小時 新手友好度 76/100
microsoft/winget-cli#6493 · 1 則留言 ·
維護者通常 2 天內回覆
-
Issue-Feature
難度 2/5 1-3 小時 新手友好度 68/100
microsoft/winget-cli#6427 ·
維護者通常 2 天內回覆
-
Issue-Docs msstore
難度 2/5 1-3 小時 新手友好度 64/100
microsoft/winget-cli#6331 · 1 則留言 ·
維護者通常 2 天內回覆
-
Command-Source Issue-Bug
難度 2/5 1-3 小時 新手友好度 68/100
microsoft/winget-cli#6148 ·
維護者通常 2 天內回覆
查看 microsoft/winget-cli 的全部 Issue
相似的 Issue
-
feat
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
-
難度 2/5 1-3 小時 新手友好度 75/100
stratum-mining/sv2-tp#167 ·
維護者通常 1 天內回覆
-
better error message bug low priority semantics strings
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
Sign up button opens the Sign in page instead of the Sign up page for Enterprise edition servers未關閉auth bug ui/ux
難度 2/5 1-3 小時 新手友好度 72/100
MerginMaps/mobile#4795 ·
維護者通常 2 天內回覆