Execution Policy
Cheat sheet · https://pcornel.dk/topic.php?topic=3048
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 versionGet-Command <name>— which cmdlet/function/exe runsGet-Help <cmdlet> -Full— syntax and parametersGet-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
| Item | Meaning | Evidence boundary |
|---|---|---|
| MachinePolicy/UserPolicy | Group Policy scopes | can dominate local configuration |
| Process | Current session scope | lost when process ends |
| CurrentUser | User-level configured policy | not machine-wide |
| LocalMachine | Computer-level configured policy | requires appropriate rights to change |
| Effective policy | Result after precedence | not 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