What this thread does
Do first: run Get-ExecutionPolicy -List in the PowerShell window that rejects Activate.ps1, then inspect the highest-priority defined scope.
Short answer
As of November 2026, current Windows PowerShell-policy docs say Process affects only the current session and loses to Group Policy. Activation is optional: invoke the environment’s Python interpreter by its full path (policy, venv).
Choose / don't choose
- Direct interpreter: choose for CI or a managed computer where shell policy should stay unchanged; invoke the environment’s Python interpreter by its full path without activation (venv).
- Session scope: choose for a local interactive session when policy allows; don't expect it to override
MachinePolicyorUserPolicy(policy). - User scope: choose for an intentional persistent user preference; Python documents
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. Don't omit the scope: the cmdlet default isLocalMachine(venv, cmdlet).
Not for: editor interpreter mismatch; see python-modulenotfounderror-but-pip-installed-which-python-is-running.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
Get-ExecutionPolicy -List | Read all scopes in precedence order before changing any | Current Windows policy docs | policy |
Get-ExecutionPolicy | No arguments shows the effective policy | Current Windows policy docs | cmdlet |
Set-ExecutionPolicy -Scope Process | Process affects only the current PowerShell session; its environment variable is deleted when the session closes | Current Windows policy docs | policy |
Set-ExecutionPolicy -Scope CurrentUser | Python documents RemoteSigned with -Scope CurrentUser; CurrentUser has second-highest precedence below Process when Group Policy is absent | Current Python/PowerShell docs | venv, policy |
Unblock-File -LiteralPath | Review the file and its source first; Unblock-File removes the Zone.Identifier alternate data stream | Current Windows PowerShell utility docs | cmdlet |
Order of operations
1. Use the exact failing host. powershell.exe and pwsh.exe manage their policy settings separately (cmdlet). 2. Read scope precedence: Process has highest precedence when Group Policy is absent; CurrentUser is second and LocalMachine is lowest. Undefined means no execution policy is set in that scope (policy). 3. If Group Policy requires signatures, use an approved signed script or invoke Python directly; a lower-priority user/session change cannot override it. For PowerShell activation, the documented path is <venv>\Scripts\Activate.ps1 (policy, venv). 4. If still blocked, re-read the effective policy. Review the downloaded file and its source before using Unblock-File; it removes the Zone.Identifier alternate data stream (cmdlet).
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
running scripts is disabled on this system | Effective policy blocks activation | Inspect scopes; choose permitted session RemoteSigned or the direct interpreter | Maddy Guthridge's March 11, 2026 report, policy |
overridden by the Group Policy applied to your system | A higher-priority Group Policy wins despite the local preference being saved | Follow the organizational policy or skip activation; do not keep loosening lower scopes | cmdlet example |
Missing
- A policy change does not repair an absent environment or wrong interpreter. This scope applies to Windows policy enforcement; non-Windows PowerShell has different behavior.
Checked
2026-11-12; Python venv docs; Microsoft policy reference updated August 31, 2026; Set-ExecutionPolicy/Unblock-File docs and dated Guthridge report read. No policy or environment commands executed.
Started from a post by @Microsoft, packaged by the editor. Original post