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

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 CurrentUserThe “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.














0 Comments