How to fix running scripts is disabled on this system error

0
594
How to fix running scripts is disabled on this system error

Are you wonder for this? If you try to run a PowerShell script and you may get some errors. Like, “running scripts is disabled on this system“. This is because you have to enable scripts to run on your machine first. Of course, This issue is fairly straightforward one, You can make a few changes in administration to get it to work. The reason for the error is that the PowerShell execution policy, Does not permit to run and execute scripts.

This is because of your computer safety So that virus and malicious code doesn’t take over your computer control. But on many occasions, we need to run certain scripts to do many things. It can be tedious to do much work manually, And a script helps us to do it in a few seconds.

Scripts are nothing but command written for the computer to execute certain actions without the permission of the device. If you are facing the issue of running scripts is disabled on this system, You can easily fix this in a few steps.

Learn to solve the running script is disabled on this system error. 

In fact, PowerShell always keeps the execution policy to restricted(unable to access properly when this restricted mode is ON). And does not allow to run third party scripts. This does not mean that you can’t run the script through PowerShell. It means that you must need to change the execution policy of PowerShell from Restricted to Set-ExecutionPolicy cmdlet.

This will allow you to easily run the script, You need to set the policy to RemoteSigned. For using scripts from third-party sources.

C:\> Set-ExecutionPolicy RemoteSigned

The understanding of PowerShell execution policy is a must If you want to not run into errors in the future. There are in-total four execution policies on PowerShell. I have listed all of them below, And their simple description for your reference.

Restricted:

This is the default execution policy of PowerShell, If not change otherwise. By using this restricted policy, You are not allowed to run any type of scripts on your machine/system.

AllSigned:

If you have saved your PowerShell policy to the following. Then you might able to run scripts, But only from the trusted publisher and those whom you have assigned trusted.

RemoteSigned:

This is the most common execution policy many people like to prefer. Here, the script that you have downloaded and must needs to be signed by a trusted publisher.

Unrestricted:

This execution policy, Allow you to run all scripts of your choice.

To know your current execution policy:

C:\> get-executionpolicy

To avoid using the default execution policy when running the script

c:\> powershell -ExecutionPolicy ByPass -YourFile script.rt5

See Also…
Fix “Cant take Screenshot due to security policy”(Opens in a new browser tab)

LEAVE A REPLY

Please enter your comment!
Please enter your name here