Hi,
According to the link you provided, the Group Policy setting overrides the execution policies set in PowerShell in all scopes, including that set with the “-executionpolicy” parameter. When the group policy is not configured, the “-executionpolicy” parameter sets the execution policy for the current session but it doesn't change the execution policy that is set in the registry.
When determining the effective execution policy for a session, PowerShell evaluates the execution policies in the following precedence order:
Group Policy: MachinePolicy
Group Policy: UserPolicy
Execution Policy: Process (or pwsh.exe -ExecutionPolicy)
Execution Policy: CurrentUser
Execution Policy: LocalMachine
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.