Title: Keep network mapping failures from aborting drives by mapleluvr · Pull Request #28443 · PowerShell/PowerShell · GitHub
Open Graph Title: Keep network mapping failures from aborting drives by mapleluvr · Pull Request #28443 · PowerShell/PowerShell
X Title: Keep network mapping failures from aborting drives by mapleluvr · Pull Request #28443 · PowerShell/PowerShell
Description: PR Summary Keep FileSystem provider initialization, including the Temp: drive, working when optional network mapping display metadata cannot be queried. Catch only Win32Exception around GetRootPathForNetworkDriveOrDosDevice in InitializeDefaultDrives. Leave DisplayRoot null, retain the drive-letter root and continue the existing registration/Temp logic. Native helpers, access checks, drive flags and other exception behavior are unchanged. Add a real Windows regression using an exact-owned, user-scoped, volatile DOS-device link to a unique unavailable localhost UNC path. The test requires actual Network/unready/WNet-failure evidence, opens a fresh real runspace and checks Temp, a healthy local drive and the network letter/root. Cleanup removes only its exact target. No SMB share/server, credentials or service setup is needed; unsupported Windows fixture setup fails rather than silently passes. Fix #28268 (the Win32 mapping-query failure case). PR Context This was reproduced in a tool-gateway workspace using ovnfs' default WinFsp Network frontend and MXC's native process-container filesystem policy. This is a general PowerShell fix: it contains no ovnfs/MXC name-specific handling, permission expansion, mapping/helper rewrite or stderr filtering. Under the unchanged restricted policy, the mounted drive is ready; WNetGetConnection and QueryDosDevice both return error 5. The unchanged helper still throws Win32Exception 5 after this patch, but optional display metadata no longer interrupts default drive initialization. Native successful mapping queries preserve the normal DisplayRoot. A whole-drive catch would incorrectly drop the workspace drive. Ready drives can be recovered by lazy automount even when initialization is incomplete, and permitted IO can already work on the failing build. Accordingly, the oracle checks fresh initial/secondary runspace Temp registration independently from allowed file operations, warning text and exit status. Local validation and limits Environment: Windows 11 build 26200.9711, installed Microsoft-signed MSIX PowerShell 7.7.0, existing WinFsp 2.1.25156; private SDK 11.0.100/.NET 11.0.0. Local self-contained Release builds used upstream Start-PSBuild with public NuGet; gallery-bundled modules and experimental-feature generation were not restored/generated. No global shell/SDK, services, drivers or ACL configuration was changed. Unmodified official MSIX 7.7.0, pinned master c422f721c132bcbc3d87bca3bad0fc7902b4a1bb and local v7.7.0 controls reproduce missing Temp under the real ready Network/restricted-process case; their Native controls pass. Exact fix commit 5227715310b1b78150e7e5d7cd3ea7338bdd13ce and an identical-code/test local 7.7.0 backport pass both Native and unchanged restricted-policy cases. Fresh initial/secondary Temp, module discovery/import, cwd, enumeration and actual PS/.NET reads/writes were checked. Actual readonly write and denied read/write still fail with UnauthorizedAccessException; host-observed source/readonly/denied sentinels remain unchanged. The new unready-network xUnit regression fails at missing Temp before the fix and passes after it. Focused production-source xUnit: 14 passed, 0 failed, 1 existing unconditional flaky-test skip. xUnit compiles its own production assemblies; these are not presented as the published-shell binaries. The three unchanged safe FileSystem Pester describes (long paths, extended Item/Content and extended Path/Location), run with Pester 4.10.1 on each fixed published build: 63 passed, 0 failed, 1 existing OS-inapplicable skip per build. Native local-SUBST and normal network mapping controls also pass. Complete stdout/stderr bytes, source/build identity, native error branches, actual output bytes and exact-owned fixture cleanup were retained locally and independently reviewed. No host paths, private policy grants, credentials or fixture-state files are included in this PR. No full-suite/upstream-CI, official-package equivalence, other Windows/security-context or full gateway-integration claim. Direct-UNC/network-backed SUBST generic parser exceptions are not repaired or covered by this Win32-only patch. Developed with coding-agent assistance and independently reviewed. Upstream CI/review remain separate acceptance gates; no CLA or other legal agreement has been signed as part of this task. PR Checklist Meaningful imperative title and summarized changes. Correct copyright/license headers on the new C# test. Ready for review; this does not claim upstream merge checks have passed. No breaking API/cmdlet changes. No new cmdlet/parameter/about-topic documentation required for this initialization regression fix; maintainer documentation requirements remain applicable. Added a production-path regression test and ran focused local validation.
Open Graph Description: PR Summary Keep FileSystem provider initialization, including the Temp: drive, working when optional network mapping display metadata cannot be queried. Catch only Win32Exception around GetRootPath...
X Description: PR Summary Keep FileSystem provider initialization, including the Temp: drive, working when optional network mapping display metadata cannot be queried. Catch only Win32Exception around GetRootPath...
Opengraph URL: https://github.com/PowerShell/PowerShell/pull/28443
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:727aee55-f1e0-4ee3-cc8f-7725addec302 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E23C:55614:20D5EE:2B59AA:6AFD0268 |
| html-safe-nonce | 24bc555ead169ab6626db9294d470625060224291911e6d38266f62ad9cabfeb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjNDOjU1NjE0OjIwRDVFRToyQjU5QUE6NkFGRDAyNjgiLCJ2aXNpdG9yX2lkIjoiNjYwNTA0MjcwOTUxNjA1OTI0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fb2d4b3740d6652ad2dc4c6a9420e7496e1c6db372dd8b24be0dbc8fc8e87452 |
| hovercard-subject-tag | pull_request:5363653489 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/PowerShell/PowerShell/pull/28443/files |
| twitter:image | https://avatars.githubusercontent.com/u/277216670?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/277216670?s=400&v=4 |
| og:image:alt | PR Summary Keep FileSystem provider initialization, including the Temp: drive, working when optional network mapping display metadata cannot be queried. Catch only Win32Exception around GetRootPath... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8fd5a24ae29aa78df114eaaf1f9a839e8c3b7c0d27549e4f54678bb7cf3166d4 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd0990b833f227378ab84f1d9519db1a04660550 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width