René's URL Explorer Experiment


Title: Unhandled Win32Exception during network-drive discovery interrupts FileSystem provider initialization in AppContainer · Issue #28268 · PowerShell/PowerShell · GitHub

Open Graph Title: Unhandled Win32Exception during network-drive discovery interrupts FileSystem provider initialization in AppContainer · Issue #28268 · PowerShell/PowerShell

X Title: Unhandled Win32Exception during network-drive discovery interrupts FileSystem provider initialization in AppContainer · Issue #28268 · PowerShell/PowerShell

Description: Summary On Windows, a failure to resolve a network drive's mapping inside an AppContainer-restricted process can abort FileSystemProvider.InitializeDefaultDrives(). In the observed environment, both WNetGetConnectionW and the subsequent ...

Open Graph Description: Summary On Windows, a failure to resolve a network drive's mapping inside an AppContainer-restricted process can abort FileSystemProvider.InitializeDefaultDrives(). In the observed environment, bot...

X Description: Summary On Windows, a failure to resolve a network drive's mapping inside an AppContainer-restricted process can abort FileSystemProvider.InitializeDefaultDrives(). In the observed environment,...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/28268

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unhandled Win32Exception during network-drive discovery interrupts FileSystem provider initialization in AppContainer","articleBody":"### Summary\n\nOn Windows, a failure to resolve a network drive's mapping inside an AppContainer-restricted process can abort `FileSystemProvider.InitializeDefaultDrives()`.\n\nIn the observed environment, both `WNetGetConnectionW` and the subsequent DOS-device fallback fail with `ERROR_ACCESS_DENIED (5)`. The fallback throws `Win32Exception`, which is not caught by the per-drive exception handling in `InitializeDefaultDrives()`.\n\nThis leaves provider initialization incomplete even though ordinary filesystem operations in the permitted workspace still succeed.\n\n### Environment\n\n- Windows 11 Pro for Workstations Insider Preview, x64, version 10.0.26220.\n- Official MSI-installed PowerShell 7.6.8 was the unmodified control.\n- Restricted execution: Codex Windows MXC sandbox with a workspace-write permission profile.\n- The same Windows user has existing mapped network drives. Private share names are omitted.\n- The launcher was a local build of Codex CLI 0.164.0 containing separate SystemRoot-environment and Windows SQL-migration line-ending fixes. This is not a claim that the launcher binary was an unmodified official release.\n- The PowerShell source used for the local comparison was tag `v7.6.8`, commit `6e29e4530c5631b6d3d2afacb49c6f1267fb0b42`.\n\n### Steps to reproduce\n\nPrerequisite: a Windows environment with an existing network drive visible to `DriveInfo.GetDrives()`, and a restricted process in which network-mapping/DOS-device queries return access denied. I have reproduced this using MXC; I have not independently reproduced it with a minimal standalone CreateAppContainerProfile launcher, or established that every AppContainer configuration is affected.\n\n1. Start the unmodified PowerShell executable outside the sandbox with `-NoLogo -NoProfile -NonInteractive`.\n2. Execute:\n\n   ```powershell\n   [Console]::WriteLine($PSVersionTable.PSVersion.ToString())\n   [Console]::WriteLine([bool](Get-PSDrive -Name Temp -ErrorAction SilentlyContinue))\n   [IO.DriveInfo]::GetDrives() | Select-Object Name, DriveType\n   Get-PSDrive -PSProvider FileSystem | Select-Object Name, Root, DisplayRoot\n   ```\n\n3. Run the same executable and commands through the MXC workspace sandbox. The launcher invocation used in the investigation has this form:\n\n   ```powershell\n   & codex -c 'windows.sandbox=\"mxc\"' -c 'features.prefer_mxc=true' sandbox --permission-profile ':workspace' -C $independentTestDirectory -- 'C:\\Program Files\\PowerShell\\7\\pwsh.exe' -NoLogo -NoProfile -NonInteractive -File $probeScript\n   ```\n\n   Both variables above designate an independent local diagnostic directory/script. No profile, registry execution-policy bypass, drive remapping, service change, or ACL adjustment is required for these comparisons.\n\n4. Compare provider startup and the Temp drive. To investigate the underlying failure, capture managed first-chance exceptions while creating another runspace and triggering its FileSystem provider.\n\n### Actual behavior and captured exception\n\nThe sandboxed control prints the FileSystem provider initialization warning. Its initial `$Error` collection is empty, so inspecting `$Error` after startup did not recover the original exception. The command can still exit 0 and perform permitted local writes.\n\nA process-local `AppDomain.CurrentDomain.FirstChanceException` handler, used while opening/using a separate runspace, captured this exception chain. Localized message text is omitted:\n\n```text\nSystem.Management.Automation.ProviderInvocationException\n ---> System.Management.Automation.ProviderInvocationException\n ---> System.ComponentModel.Win32Exception (5)\n   at Interop.Windows.GetDosDeviceForNetworkPath(Char deviceName)\n   at Microsoft.PowerShell.Commands.FileSystemProvider.WinGetSubstitutedPathForNetworkDosDevice(String driveName)\n   at Microsoft.PowerShell.Commands.FileSystemProvider.GetRootPathForNetworkDriveOrDosDevice(DriveInfo driveInfo)\n   at Microsoft.PowerShell.Commands.FileSystemProvider.InitializeDefaultDrives()\n   at System.Management.Automation.SessionStateInternal.InitializeProvider(...)\n```\n\nIndependent native API probes and direct reflection calls to the installed provider method gave:\n\n| Probe | Normal process | MXC process |\n| --- | --- | --- |\n| WNetGetConnectionW for each of two mapped drives | Success, correct UNC mapping | Error 5 |\n| QueryDosDeviceW for those drive letters | Success | Error 5 |\n| GetRootPathForNetworkDriveOrDosDevice for those drives | Correct UNC mapping | Win32Exception (5) |\n| Temp PSDrive after startup | Present | Absent |\n\nThe API error results were measured directly, rather than inferred only from the warning.\n\n### Expected behavior\n\nFailure to obtain optional network-drive mapping/display information should not prevent the provider from finishing initialization of other drives, including Temp.\n\nA possible behavior is to retain the drive-letter root with an unavailable DisplayRoot and continue initialization. This does not require granting additional permissions to the restricted process or making inaccessible filesystem paths accessible.\n\nThe underlying reason MXC denies these queries has not been established here. This report concerns PowerShell's handling of that failure.\n\n### Source inspection and local comparison\n\nIn [FileSystemProvider.cs at the tested commit](https://github.com/PowerShell/PowerShell/blob/6e29e4530c5631b6d3d2afacb49c6f1267fb0b42/src/System.Management.Automation/namespaces/FileSystemProvider.cs):\n\n- `GetRootPathForNetworkDriveOrDosDevice()` catches failure of the initial network-mapping lookup and can attempt the DOS-device fallback.\n- The per-drive handling in `InitializeDefaultDrives()` catches `IOException`, `SecurityException`, and `UnauthorizedAccessException`, but not `Win32Exception`.\n\nI built a local comparison that handles `Win32Exception` around this network lookup and retains a null DisplayRoot. This was tested with the same sandbox policy:\n\n| PowerShell build/context | Initialization warning | Temp drive | Probe script and permitted file write |\n| --- | --- | --- | --- |\n| Official 7.6.8, normal process | No | Present | Pass |\n| Official 7.6.8, MXC | Yes | Absent | Pass |\n| Local comparison, normal process | No | Present | Pass |\n| Local comparison, MXC | No | Present | Pass |\n\nFresh process tests after local installation also passed. Sandbox boundary checks continued to reject writes outside the permitted workspace. No configuration, service, or lasting ACL change was used to obtain these results.\n\nThis comparison supports handling the mapping exception gracefully; it does not establish that all network-drive initialization failures have the same cause.\n\n### Related reports\n\n- #7212, especially [this comment](https://github.com/PowerShell/PowerShell/issues/7212#issuecomment-501336453), describes the same network-drive discovery function failing in a Windows container. That issue was later [closed for inactivity](https://github.com/PowerShell/PowerShell/issues/7212#issuecomment-1824436557), which does not establish that this current case was fixed.\n- #27253 concerns a different AppContainer failure involving fixed-drive root existence checks; I am not claiming it is the same defect.\n- [openai/codex#55004](https://github.com/openai/codex/issues/55004) reports the startup warning and empty error collection, but does not contain this captured inner exception chain.\n\nPlease consider making FileSystem provider initialization resilient to this network-mapping Win32Exception, and adding coverage for failed mapping queries in a restricted Windows context.\n\nNo private share names, user/project paths, credentials, transfer URLs, or raw session logs are included.\n\n","author":{"url":"https://github.com/mcc1","@type":"Person","name":"mcc1"},"datePublished":"2026-10-26T20:01:20Z","url":"https://github.com/PowerShell/PowerShell/issues/28268"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bdef9ce8-63a7-53d8-ce68-c2fdac87f43e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAB5C:39985A:1CC72D:25EE80:6AFD0138
html-safe-nonce5bb1626901643efaf806b114a53543fa35e90a96fae27566a168d4aa679b27c7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjVDOjM5OTg1QToxQ0M3MkQ6MjVFRTgwOjZBRkQwMTM4IiwidmlzaXRvcl9pZCI6IjIyMjc3MDAyNzI5NDYwMjA2NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9085fde4cdf46a6fa844124b4f7a82bdd795c0cbd8e6f53e92466c6ab743bf38
hovercard-subject-tagissue:6047190418
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/28268/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8f66349712fb55ffc093246e0eb582eb1daaa8483a7487a136834f4fb5347ac4/PowerShell/PowerShell/issues/28268
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8f66349712fb55ffc093246e0eb582eb1daaa8483a7487a136834f4fb5347ac4/PowerShell/PowerShell/issues/28268
og:image:altSummary On Windows, a failure to resolve a network drive's mapping inside an AppContainer-restricted process can abort FileSystemProvider.InitializeDefaultDrives(). In the observed environment, bot...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemcc1
hostnamegithub.com
expected-hostnamegithub.com
Nonecfabad6ee26d2b84c7afef4ae0cc71b8b692fb9d66f9f15997652ef991bfd3f4
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release35f85b78676038389558a41adf8d76e474592ede
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/28268#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F28268
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F28268
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/28268
Reloadhttps://github.com/PowerShell/PowerShell/issues/28268
Reloadhttps://github.com/PowerShell/PowerShell/issues/28268
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests364 (364)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28268
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28268
#28443https://github.com/PowerShell/PowerShell/pull/28443
Unhandled Win32Exception during network-drive discovery interrupts FileSystem provider initialization in AppContainerhttps://github.com/PowerShell/PowerShell/issues/28268#top
#28443https://github.com/PowerShell/PowerShell/pull/28443
https://github.com/mcc1
mcc (mcc1)https://github.com/mcc1
on Oct 26, 2026https://github.com/PowerShell/PowerShell/issues/28268#issue-6047190418
FileSystemProvider.cs at the tested commithttps://github.com/PowerShell/PowerShell/blob/6e29e4530c5631b6d3d2afacb49c6f1267fb0b42/src/System.Management.Automation/namespaces/FileSystemProvider.cs
PowerShell in Docker container does not map container drive mounts at start-up #7212https://github.com/PowerShell/PowerShell/issues/7212
this commenthttps://github.com/PowerShell/PowerShell/issues/7212#issuecomment-501336453
closed for inactivityhttps://github.com/PowerShell/PowerShell/issues/7212#issuecomment-1824436557
FileSystem PSDrives not mounted when PowerShell runs inside an AppContainer #27253https://github.com/PowerShell/PowerShell/issues/27253
openai/codex#55004https://github.com/openai/codex/issues/55004
https://github.com/stavin
Gupus (stavin)https://github.com/stavin
on Oct 26, 2026https://github.com/PowerShell/PowerShell/issues/28268#issuecomment-6427922396
#20894https://github.com/PowerShell/PowerShell/issues/20894
https://github.com/janfila
janfilahttps://github.com/janfila
on Oct 29, 2026https://github.com/PowerShell/PowerShell/issues/28268#issuecomment-6508327778
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/namespaces/FileSystemProvider.cshttps://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/namespaces/FileSystemProvider.cs
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cshttps://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs
https://repository-images.githubusercontent.com/49609581/aad0ad80-cdec-11ea-8248-a37bc0571bfd
https://camo.githubusercontent.com/7e41d4698b37a89b2a8c06057583a5f48ce614b0fb7e2b93d27a2ec01c8f024b/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f66617669636f6e732f66617669636f6e2e737667
PowerShell/src/System.Management.Automation/namespaces/FileSystemProvider.cs at master · PowerShell/PowerShellhttps://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/namespaces/FileSystemProvider.cs
https://repository-images.githubusercontent.com/49609581/aad0ad80-cdec-11ea-8248-a37bc0571bfd
https://camo.githubusercontent.com/7e41d4698b37a89b2a8c06057583a5f48ce614b0fb7e2b93d27a2ec01c8f024b/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f66617669636f6e732f66617669636f6e2e737667
PowerShell/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs at master · PowerShell/PowerShellhttps://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs
https://github.com/wtq0816
wtq0816https://github.com/wtq0816
on Nov 7, 2026https://github.com/PowerShell/PowerShell/issues/28268#issuecomment-6705096392
mcc (@mcc1)https://github.com/mcc1
Gupus (@stavin)https://github.com/stavin
https://github.com/mcc1
mcc (mcc1)https://github.com/mcc1
on Nov 8, 2026https://github.com/PowerShell/PowerShell/issues/28268#issuecomment-6725547788
wtq0816https://github.com/wtq0816
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/28268
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28268
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.