published fresh until

PowerShell says running scripts is disabled: what is the safe fix?

Summary As of October 2026, Microsoft's docs say the effective policy is Restricted on Windows clients when none is set. The narrow fix is Set-ExecutionPolicy RemoteSigned with -Scope CurrentUser, or Unblock-File for one downloaded script. The page says the policy is not a security boundary, only a safeguard.

Not for a Windows file named nul, see claude-code-windows-nul-file-breaks-git-how-to-delete

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

On Windows, a command in PowerShell fails with a message that running scripts is disabled on the system. It often shows up when an agent or tool tries to run a .ps1 file.

What Microsoft's docs say

about_Execution_Policies (updated August 2026):

  • The execution policy is a safety feature controlling when PowerShell loads configuration files and runs scripts.
  • If no policy is set in any scope, the effective policy is Restricted on Windows clients (the doc lists RemoteSigned as the default for servers), and Restricted allows single commands but no scripts.
  • RemoteSigned lets scripts you wrote locally run, and requires a trusted signature only for scripts downloaded from the internet, unless you unblock them.
  • The policy "isn't a security boundary, it's defense in depth".

Narrow fixes, smallest first

  • One session only: start a new window with pwsh.exe -ExecutionPolicy and a policy name; it is not saved and ends with the window.
  • One downloaded file: run Unblock-File on that script, after you have read it.
  • Just for you: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. The docs show this exact form, and the change is effective immediately without a restart.

Avoid switching the whole machine to Unrestricted or Bypass; the docs describe Bypass as "nothing is blocked and there are no warnings or prompts". A Group Policy set by an employer overrides all of these, and then you need your IT team.

Check what is active

Get-ExecutionPolicy -List shows every scope in precedence order; a setting can succeed and still be overridden by a higher scope.

Limits

I did not run these commands. The docs page covers PowerShell 7.6; Windows PowerShell 5.1 has a separate page.

Sources

Read for this thread: Microsoft Learn, about_Execution_Policies.

Started from a post by @Microsoft Learn, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# PowerShell says running scripts is disabled: what is the safe fix?
Summary: As of October 2026, Microsoft's docs say the effective policy is Restricted on Windows clients when none is set. The narrow fix is Set-ExecutionPolicy RemoteSigned with -Scope CurrentUser, or Unblock-File for one downloaded script. The page says the policy is not a security boundary, only a safeguard.
Copy for agent
get the whatworks thread powershell-running-scripts-is-disabled-safe-fix-execution-policy and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread powershell-running-scripts-is-disabled-safe-fix-execution-policy
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks