[release/v7.4.21] Add support for new WLDP setting EnableFileOnlyEntry - #28041
Open
Aditya Patwardhan (adityapatwardhan) wants to merge 2 commits into
Conversation
Aditya Patwardhan (adityapatwardhan)
requested review from
a team,
Patrick Meinecke (SeeminglyScience) and
Travis Plunk (TravisEz13)
as code owners
September 21, 2026 21:08
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Aditya Patwardhan (adityapatwardhan)
September 21, 2026 21:08
View session
3 of 9 tasks
Justin Chung (jshigetomi)
approved these changes
Sep 23, 2026
Contributor
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #26752 to release/v7.4.21
Triggered by Aditya Patwardhan (@adityapatwardhan) on behalf of Patrick Meinecke (@SeeminglyScience)
Original CL Label: CL-Engine
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Customer Impact
Adds support for the Windows WLDP EnableFileOnlyEntry policy so managed systems can require a script file and disallow unintended interactive or ad-hoc PowerShell entry. Without the change, release/v7.4 does not honor this policy setting.
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
Cherry-pick validated with git diff --check. Added PowerShell tests and HelpersSecurity module both parse successfully with no conflict markers. A focused ConsoleHost dotnet build was attempted after restore; it is blocked by pre-existing generated-resource errors for DotNetEventingStrings in Microsoft.PowerShell.CoreCLR.Eventing, unrelated to this change. Full validation is delegated to backport CI.
Risk
REQUIRED: Check exactly one box.
High risk because this changes ConsoleHost startup and Windows WLDP policy enforcement. The implementation and tests are carried from the merged original PR, the sole conflict was a control-flow/formatting divergence, and the resolution preserved release-branch structure while retaining the intended successful return.
Merge Conflicts
src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.csconflicted because release/v7.4.21 retained older V2 socket-server formatting/control flow while the original PR used the refactored early-return form. Resolved by keeping the release context and usingreturn ExitCodeSuccessafterHyperVSocketMediator.Run, matching the surrounding release-branch server-mode paths and preserving the backport intent.