Win11 26H2: user PATH (~3.6k) not applied to new processes — winget missing in cmd/PS 5.1/pwsh
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp, powershell
- Lĩnh vực
- cli, operating-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 26.6k
- Fork
- 1.8k
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 41
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/winget-cli
-
Issue-Docs Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
microsoft/winget-cli#6692 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Issue-Docs Possible-Duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/winget-cli#6493 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
WinGetSourceCreator: PackWithMappingFile should verify makeappx.exe exists before invoking itĐang mởIssue-Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/winget-cli#6427 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Issue-Docs msstore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
microsoft/winget-cli#6331 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Command-Source Issue-Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/winget-cli#6148 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/winget-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stratum-mining/sv2-tp#167 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Sign up button opens the Sign in page instead of the Sign up page for Enterprise edition serversĐang mởauth bug ui/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MerginMaps/mobile#4795 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
HarperFast/rocksdb-js#1118 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
26.04 bug dark-mode Easy Hack impress symptom: visual
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CollaboraOnline/online#16421 · 1 bình luận ·