In this Video I will share how to Fix .
ps1 cannot be loaded because running scripts is disabled on this system error when trying
to run script on the PowerShell application.
When we try to run script it gives the error, Script cannot be loaded because
running scripts is disabled on this system.
Steps to Fix .
ps1 cannot be loaded because running is disabled error in PowerShell:.
Run windows PowerShell as an Administrator.
Or you can open any PowerShell which were trying to run the Script file on.
We will check what is the script policy set on the affected computer.
Run the following command in the PowerShell window, to know the current script
execution mode set on your computer.
Get-ExecutionPolicy.
The output of the above command look something like this.
For my computer it is set to Restricted, I can allow it for everyone logging
on the computer or just myself by running the below command respectively.
To allow everyone logging on the computer be able to run script,
run the following command.
Set-ExecutionPolicy RemoteSigned.
After you run the above command you will be prompted to confirm the changes, you can
type A or Y. This will set the policy and you should then be able to run the script.
To allow only your account logged on the computer be able to run
script, run the following command.
Set-ExecutionPolicy -Scope CurrentUser.
After you run the above command you will be prompted to confirm the changes, you can
type A or Y. This will set the policy and you should then be able to run the script.
Setting the execution policy as RemoteSigned allows it to run the script or files
which are signed by trusted publisher.
After running the above if still you are not able to run the scripts and get the same
error then you can run the below command.
Set-ExecutionPolicy Unrestricted.
After you run the above command you will be to confirm the changes, you can type A or Y.
This will set the policy accordingly and should then be able to run the script.
The command remove all the restriction running script on your computer.
If you are getting any error in setting it or want to set it for your user
account only, then you can run the below.
Set-ExecutionPolicy -Scope CurrentUser.
In conclusion to fix .
ps1 cannot be loaded because running scripts is disabled error run
the command Set-ExecutionPolicy RemoteSigned before running script.
If you have any question please it in the comment section.