PowerShell error “execution of scripts is disabled on this system” | Solution

Simple, safe, easy, and permanent solutions to enable PowerShell scripts on Windows without breaking security.6 min


PowerShell says, “execution of scripts is disabled on this system.” error

If you have ever tried running a PowerShell script and hit this message:

Execution of scripts is disabled on this system.

Don’t worry, and be relaxed. I am here to provide you with valuable ways to solve this issue easily.

This is one of the most common issues on Windows, and it is not a bug! It is there as a security feature. In this guide, I will show you,

  • Why does this error happen!?
  • The safest way to fix it
  • Multiple working solutions (temporary + permanent)
  • Best practices so you don’t expose your system

Let’s solve it properly and in the right direction.

Why PowerShell Blocks Scripts by Default

Generally, Windows restricts PowerShell scripts using something called Execution Policy. Its job is really simple that, it will prevent malic*ous scripts from running automatically.

The default value is set as Restricted , which means no scripts allowed at all. So when you try to run .ps1 files, this PowerShell will block them for security concerns.

Remember that it is good for security and bad when you are trying to actually work!

You may like this article too,

[Solved] ‘ng.ps1 Cannot Be Loaded’ Error in Angular for ng build

Quick Check: See Your Current Execution Policy

First of all, open your PowerShell as Administrator and run:

Get-ExecutionPolicy

Common outputs:

  • Restricted (most common)
  • RemoteSigned
  • AllSigned
  • Unrestricted

If it says Restricted, that is the actual problem.

# Solution 1: Best & Safest for Most Users

You need to enable scripts only for your user account by following this approach.

This is the recommended fix.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Then type: Y when it prompts.

What this does:

  • Allows scripts you create locally, and
  • Blocks unsigned scripts downloaded from the internet

Why is it safe:

You’re not opening system-wide permissions. You are just enabling scripts only for your user account.

Try running your script again:

.yourScript.ps1

It should work now.

# Solution 2: Temporary Fix — Great for quick testing

If you don’t want to change system settings permanently, this solution is for you.

powershell -ExecutionPolicy Bypass

By executing the above command, this opens a new PowerShell window where scripts are allowed — actually bypassing the security checks.

Make sure that it will work only for that session.

Once it is closed, your policy behavior will return to normal again.

It can be perfect scenarios like,

  • Testing scripts
  • Running installers
  • One-time tasks, etc.

# Solution 3: System-Wide — For advanced users or servers

If you are working in an IT company and have a restricted account, please use this command wisely if permitted. If you manage machines or automation pipelines, this is what you can try.

Set-ExecutionPolicy RemoteSigned

This applies to all users under your network.

Warning: The best advice from me is that, use only if you understand the security impact.

# Solution 4: Unblock a specific downloaded script

In a few cases, sometimes Windows blocks files downloaded from browsers themselves; in that case, you need to run the command below.

Unblock-File .yourScript.ps1

Then try running again.

This keeps the execution policy intact while allowing that one file.

Common Mistakes That Cause This Error

I saw many cases, where people might –

  • Forgetting . before script name
  • Running PowerShell without admin permissions when required
  • Using a restricted policy unknowingly
  • Downloaded scripts blocked by Windows

The best and correct way to run is given below,

.scriptname.ps1

Recommended execution policy and risk factors | Image by Author created in MS Paint

Trust me, For 99% users: RemoteSigned is perfect

Conclusion:

If you’re a developer, student, or IT user, I recommend that you use this command as it is secure, simple, and permanent.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

The “Execution of scripts is disabled on this system” error isn’t a problem; it’s PowerShell protecting you. Once you understand execution policies, fixing them takes less than a minute and keeps your system secure.

If you work with automation, DevOps, or Windows tools, this is a must-know PowerShell skill.


Discover more from 9Mood

Subscribe to get the latest posts sent to your email.


Like it? Share with your friends!

What's Your Reaction?

Lol Lol
0
Lol
WTF WTF
0
WTF
Cute Cute
0
Cute
Love Love
0
Love
Vomit Vomit
0
Vomit
Cry Cry
0
Cry
Wow Wow
0
Wow
Fail Fail
0
Fail
Angry Angry
0
Angry
Rakshit Shah

Senior

Hey Moodies, Kem chho ? - Majama? (Yeah, You guessed Right! I am from Gujarat, India) 25, Computer Engineer, Foodie, Gamer, Coder and may be a Traveller . > If I can’t, who else will? < You can reach out me by “Rakshitshah94” on 9MOodQuoraMediumGithubInstagramsnapchattwitter, Even you can also google it to see me. I am everywhere, But I am not God. Feel free to text me.

0 Comments

Leave a Reply

Choose A Format
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Ranked List
Upvote or downvote to decide the best list item
Open List
Submit your own item and vote up for the best submission
Countdown
The Classic Internet Countdowns
Meme
Upload your own images to make custom memes
Poll
Voting to make decisions or determine opinions
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Personality quiz
Series of questions that intends to reveal something about the personality
is avocado good for breakfast? Sustainability Tips for Living Green Daily Photos Taken At Right Moment