How to Change PowerShell Execution Policy on Windows: Step-by-Step Guide

Last updated 4 months, 1 week ago · 4 min read

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

  1. Press Start, type PowerShell.
  2. Right-click Windows PowerShell (or pwsh for PowerShell Core) and choose Run as Administrator.
  3. 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 RemoteSigned for developer machines where you run local scripts you control.
  • Use AllSigned for 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

CommandPurposeExample Output
Get-ExecutionPolicyCheck current policyRestricted
Set-ExecutionPolicy RemoteSignedAllow local scripts; require signing for remoteInteractive confirmation
Set-ExecutionPolicy UnrestrictedAllow all scripts (use with caution)Interactive confirmation

PowerShell Across Platforms

The cross-platform PowerShell core binary is pwsh. Installers and documentation are available at:

https://aka.ms/pscore6

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.

Request For A Custom Website Now!

Get a Custom website and PWA that drives traffic and conversions. Start today, pay only 30% now!

Get Started Now

More Articles

Digital Transformation: Strategies for Succes

Digital Transformation: Strategies for Succes

3 months, 1 week ago · 2 min read
Why Every Business Needs to Be Registered

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

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

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)

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 #1 Rankings

Content Clusters: The Secret SEO Technique Behind Top Google Rankings

3 months, 2 weeks ago · 3 min read
How to Register Your Business in Nigeria (2025 Guide)

A Simple and Complete Guide to Registering Your Business in Nigeria (CAC 2025)

3 months, 2 weeks ago · 3 min read
Stop Keyword Stuffing: Boost Tech Website Rankings

Smart SEO Strategies for Tech Websites

3 months, 2 weeks ago · 2 min read
Build Topical Authority Through Your Website Blog

Website Blog Topical Authority Guide

3 months, 2 weeks ago · 2 min read
On-Page SEO Checklist for 2025

2025 On-Page SEO Checklist

3 months, 2 weeks ago · 2 min read