8 August 2026

PowerShell Execution Policy: Use Process Scope for a Temporary Test

When a local script is blocked by execution policy, Process scope can be useful for a temporary session without changing the machine-wide setting.


While setting up this site I hit the familiar PowerShell error:

cannot be loaded because the file is not digitally signed

Before changing anything, check the effective policies:

Get-ExecutionPolicy -List

For a temporary development session, one option is:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Process scope only applies to the current PowerShell process.

Close that PowerShell session and the setting disappears.

That makes it preferable to casually weakening the execution policy at LocalMachine scope just to test one local script.

Important

Execution policy is a safety feature, not a complete security boundary.

Before running an unfamiliar script, inspect it.

For downloaded scripts, also investigate why Windows considers the file remote or untrusted rather than automatically bypassing the warning.