Supported Windows PowerShell 5.1 bootstrap in zero-capability LPAC with a private read-only registry view

ali moghtaderi 0 Reputation points
2026-11-16T15:41:00.24+00:00

We need to run the existing, unmodified x64 Windows PowerShell executable and its native PowerShell child inside LPAC with zero capabilities.

The LPAC process exits before our script begins, reporting:

“Cannot open registry key SOFTWARE\Microsoft\PowerShell. Access is denied.”

The installed registration reports PowerShell 5.1.19041.1; the engine version has not been observed inside the restricted process. Switching from CREATE_NO_WINDOW to DETACHED_PROCESS progressed beyond an earlier initialization failure but exposed this registry error.

We cannot add registryRead or other capabilities, change host registry ACLs, replace the executable/runtime, or grant broad registry access.

  1. Is there a documented, supported way to supply a private, read-only bootstrap registry view before this executable’s first registry access, including its native child?
  2. If supported, which APIs, activation context, inheritance rules and Windows-version requirements apply? RegOverridePredefKey affects only its calling process, so remapping in the launcher alone is insufficient.
  3. If unsupported, please identify the conflicting requirement and any documented alternative. Please also distinguish necessary registry reads from optional reads; we are not requesting broad root permissions.

We are requesting documentation and supportability guidance only, not instructions to relax the controls.

Windows development | Windows API - Win32
0 comments No comments

1 answer

Sort by: Newest
  1. Gatlin Le (WICLOUD CORPORATION) 1,475 Reputation points Microsoft External Staff Moderator
    2026-11-17T03:29:09.9966667+00:00

    Hi @ali moghtaderi ,

    Thank you for listing the constraints, what you have already tried, and the point that you only need the registry reads that are actually required rather than broad access. That made it much easier to check each part of the question against the documentation.

    Your reading of RegOverridePredefKey matches the documentation, and I could not find any documented mechanism that goes beyond it. Within the constraints you listed, I found no supported way to give the unmodified executable and its native child a private read-only registry view before their first registry access, so there are no documented APIs, activation context, inheritance rules or version requirements to apply here. While this is not the outcome you were hoping for, it does give your design review a clear basis: any approach that tries to do this would depend on behavior Windows does not document.

    The RegOverridePredefKey function reference states that the remapping affects only the calling process and that the function is intended for software installation programs. Nothing on that page extends the mapping to another process or to a child.

    On inheritance for the native child, AppContainer for legacy apps states that an AppContainer process and its child processes can access only the resources specifically granted to them, and that a child created with CreateProcess typically inherits the parent's token. That is the documented behavior that applies to the PowerShell child in your scenario.

    As for necessary versus optional reads, Windows PowerShell 5.1 does not publish the registry keys it reads at startup, so Microsoft documentation does not distinguish the two.

    What I can confirm from the forum is limited to the public documentation above. If you need Microsoft to formally confirm supportability for this design, Windows Developer Support can take it to the product team. Including the Windows build, how the LPAC token is created, the exact key in the error and the constraints you listed here should help them answer without another round of questions.

    I hope the documentation I found helps you move your design review forward. If this helps clarify where the documentation stands on your scenario, I'd appreciate it if you could take a moment to follow the steps in this guidance, so others with a similar scenario can find this information more easily.

    Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.