How to Change PowerShell Execution Policy on Windows: Step-by-Step Guide
If you’ve ever tried running a PowerShell script and saw the error message “running scripts is disabled on this system”, you’re not alone. This message appears because PowerShell’s default execution policy is set to Restricted, which blocks all scripts from running for safety reasons. The good news is that this isn’t a serious error — and this article will show you exactly how to fix it.
In this step-by-step guide, you’ll learn how to change PowerShell’s execution policy from Restricted to RemoteSigned or Unrestricted, understand what each level means, and see how to apply these settings safely. We’ll also cover how this applies to the new cross-platform version of PowerShell, known as PowerShell Core.
Understanding PowerShell Execution Policies
The Execution Policy is a safety feature that determines which PowerShell scripts are permitted to run. It helps prevent accidental execution of untrusted scripts on your PC.
- Restricted — No scripts are allowed. This is the default on many Windows systems.
- AllSigned — Only scripts signed by a trusted publisher run.
- RemoteSigned — Local scripts run; downloaded scripts must be signed by a trusted publisher.
- Unrestricted — All scripts run; remote scripts show a one-time warning.
Step-by-Step: Change the Execution Policy
Step 1 — Open PowerShell as Administrator
- Press Start, type PowerShell.
- Right-click Windows PowerShell (or
pwshfor PowerShell Core) and choose Run as Administrator. - You should see a prompt similar to:
PS C:\WINDOWS\system32>
Step 2 — Check the current policy
Run:
Get-ExecutionPolicy
Expected output (default on many systems):
Restricted
Step 3 — Set Execution Policy to RemoteSigned
Run this command to allow local scripts and require signing for downloaded scripts:
Set-ExecutionPolicy RemoteSigned
PowerShell will show a confirmation prompt:
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
Type Y and press Enter to confirm.
Step 4 — (Optional) Set to Unrestricted
If you want to allow all scripts (not recommended for production systems), run:
Set-ExecutionPolicy Unrestricted
Confirm with Y when prompted.
Step 5 — Verify the change
Run:
Get-ExecutionPolicy
Example expected output after setting to unrestricted:
Unrestricted
Security Considerations
Warning: Setting the execution policy to Unrestricted or otherwise loosening policies increases risk. Execution policies are a convenience/security layer but not a replacement for endpoint protection or code review.
- Prefer
RemoteSignedfor developer machines where you run local scripts you control. - Use
AllSignedfor production systems that require higher assurance. - Only run scripts from trusted sources; inspect any downloaded script before executing it.
- Combine execution policy with code signing, antivirus, and least privilege principles.
Quick Reference
| Command | Purpose | Example Output |
|---|---|---|
Get-ExecutionPolicy | Check current policy | Restricted |
Set-ExecutionPolicy RemoteSigned | Allow local scripts; require signing for remote | Interactive confirmation |
Set-ExecutionPolicy Unrestricted | Allow all scripts (use with caution) | Interactive confirmation |
PowerShell Across Platforms
The cross-platform PowerShell core binary is pwsh. Installers and documentation are available at:
Once installed, on Linux/macOS, you can run pwsh and use the same commands shown in this guide.
Conclusion
PowerShell execution policies help balance safety with script convenience. For most development scenarios, RemoteSigned is a sensible default; choose AllSigned or keep Restricted if you need stricter control. Only use Unrestricted when you understand the risks and have compensating security controls in place.
For official documentation, visit: about_Execution_Policies.
More Articles
Digital Transformation: Strategies for Succes
3 months, 1 week ago · 2 min read
Why Every Business Needs to Be Registered
3 months, 1 week ago · 2 min read
How to Set Up Django with PostgreSQL, Nginx, and Gunicorn on Ubuntu VPS Server
3 months, 1 week ago · 12 min read
Website Copywriting Secrets That Boost SEO and Conversions
3 months, 2 weeks ago · 3 min read
How to Use Long-Tail Keywords to Attract High-Intent Buyers (2025 SEO Guide)
3 months, 2 weeks ago · 3 min read
Content Clusters: The Secret SEO Technique Behind Top Google Rankings
3 months, 2 weeks ago · 3 min read
A Simple and Complete Guide to Registering Your Business in Nigeria (CAC 2025)
3 months, 2 weeks ago · 3 min read
Smart SEO Strategies for Tech Websites
3 months, 2 weeks ago · 2 min read
Website Blog Topical Authority Guide
3 months, 2 weeks ago · 2 min read
2025 On-Page SEO Checklist
3 months, 2 weeks ago · 2 min read
x