How to Fix "Cannot be loaded because running scripts is disabled on this system"


This error message appeared when attempting to launch a PowerShell script via the PowerShell console.



Cannot be loaded because running scripts is disabled on this system. For more information, 

see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.



This is because the Windows PowerShell execution policy has been set to block scripts that are not trusted and could harm your Windows client environment. 

With client operating systems like Windows 10 PC, the default execution policy is "strict".


How to Fix

How can you fix the system problem that prevents running scripts? 

The following will allow PowerShell script execution:


1. Open powershell and run it as Administrator



x86 (32 bit) (32 bit)

Execute the command 

powershell RemoteSigned Set-ExecutionPolicy


x64 (64 bit) (64 bit)

Execute the PowerShell command.  

RemoteSigned Set-ExecutionPolicy



Conclusion

Scripts and configuration files downloaded from the internet must comply with the RemoteSigned policy and bear the trusted publisher's signature. 


R
estricted No scripting is permitted

Unrestricted - Any script may be executed; no signature is necessary.

RemoteSigned - For test and development environments, use RemoteSigned. Only files downloaded from the internet require signing. On servers, this is the default configuration.

AllSigned - local, remote script.it should be signed by a trusted publisher.