@gusf
Windows Oct 31, 2026

powershell won't run my script, says running scripts is disabled

Wrote a small .ps1 to rename files and get the "running scripts is disabled on this system" error. Which execution policy should I set, and is it safe to change it for just my user?
1

Leave A Reply

Log in to post an answer.

1 Answer

ravii Nov 04, 2026
gusf
That's the execution policy, Windows blocks scripts by default. Run this once: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned That lets your own scripts run for your user without opening up the whole machine. If the script came from the internet it may still be blocked, then run Unblock-File .\yourscript.ps1 on it. For a one-off you can also do powershell -ExecutionPolicy Bypass -File .\yourscript.ps1 without changing anything permanently. I wouldn't set it to Unrestricted.