How to Fix for PowerShell Script cannot be loaded because running scripts is disabled on this system
The message “PowerShell Script cannot be loaded because running scripts is disabled on this system” pops up due to the execution policy in PowerShell. No worries! You can fix this by changing the execution policy. Here’s a simple guide to help you do it:
How to Change the Execution
First, you need to open PowerShell with Administrative Privileges.
You can press Win + X, then pick Windows PowerShell (Admin) or Command Prompt (Admin).
Or, just search for “PowerShell” in the Start menu, right-click on it, & select Run as administrator.
Now, let’s check your current execution policy. Type this command:
Get-ExecutionPolicy
This will show what your current execution policy is. Usually, it’s set to Restricted by default.
Next step is to set your Execution Policy to either Unrestricted or RemoteSigned.
If you want to let all scripts run—
Type this:
Set-ExecutionPolicy Unrestricted
But if you’d rather allow scripts only when they’re signed by a trusted publisher—
You’ll need this:
Set-ExecutionPolicy RemoteSigned
Don’t forget to confirm the change! You might see a prompt asking for confirmation. Just type Y and press Enter.
To check if the change worked, again use the command:
Get-ExecutionPolicy
This time, it should show either Unrestricted or RemoteSigned, depending on what you chose.
Example Command:
Set-ExecutionPolicy RemoteSigned
If You Need to Go Back
What if you want to revert back? It’s easy! Simply type:
Set-ExecutionPolicy Restricted
Some Extra Notes
Execution Policy Levels: There are various scopes where you can set this policy, like LocalMachine and CurrentUser. If you just want it for your own user account, use this command:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
Security Reminder: Keep in mind that setting the policy to Unrestricted may open up security risks since it allows any script to run—including harmful ones. The RemoteSigned option provides better security because it needs scripts downloaded from the internet to be signed by a trusted publisher.
Here are the different values for the policy:
Restricted: No scripting allowed.
Unrestricted: You can run any script—no signing needed.
RemoteSigned: A good choice for testing and development environments. Only files from the internet must be signed; otherwise, you’ll see an error about .ps1 not being digitally signed. This is often the default on servers and is safer than unrestricted.
AllSigned: For both local and remote scripts—a trusted publisher must sign them. Only signed PowerShell scripts are allowed.
Hope that helps! Have fun coding in PowerShell!
Share this content: