Pcornel
Windows · PowerShell

Execution Policy

Cheat sheet · https://pcornel.dk/topic.php?topic=3048

Back to the Topic

Answer

Execution policy is a PowerShell safety feature that controls conditions for loading configuration files and running scripts on Windows. It can be set at multiple scopes, with Group Policy scopes able to override local settings. Microsoft explicitly documents that execution policy is not a security boundary.

Remember

  • Execution policy is not a security boundary and can be bypassed by a determined user with code-execution rights.
  • Effective policy comes from scope precedence, not simply the LocalMachine value.
  • MachinePolicy/UserPolicy set by Group Policy can override local Process/CurrentUser/LocalMachine settings.
  • RemoteSigned concerns scripts marked as coming from the Internet zone; origin/marking matters.
  • Changing execution policy does not grant filesystem, Registry, network or administrative permissions.

First checks

  • $PSVersionTable — PowerShell edition and version
  • Get-Command <name> — which cmdlet/function/exe runs
  • Get-Help <cmdlet> -Full — syntax and parameters
  • Get-ExecutionPolicy -List — execution policy per scope

Commands

Get-ExecutionPolicy -List
Shows the PowerShell execution policy for each scope and which one is in effect.

Verify in this order

policy scopes (MachinePolicy, UserPolicy, Process, CurrentUser, LocalMachine) → effective policy → script allowed or blocked

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

PowerShell → Execution Policy reference map

ItemMeaningEvidence boundary
MachinePolicy/UserPolicyGroup Policy scopescan dominate local configuration
ProcessCurrent session scopelost when process ends
CurrentUserUser-level configured policynot machine-wide
LocalMachineComputer-level configured policyrequires appropriate rights to change
Effective policyResult after precedencenot an authorization/security boundary

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3048

Confirmation

Confirm action

Continue?