[SOLVED] PowerShell: Running scripts is disabled on this system

While trying to run a PowerShell script you may get an error message that says “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 error message is due to the default execution policy set by PowerShell, that determines whether PowerShell scripts can be run on a system.

By default, the execution policy is set to Restricted, which means that PowerShell scripts cannot be run.

To fix this error message, it is required to change the execution policy to RemoteSigned and this post shows how to do this.

Running scripts is disabled on this system

To set the execution policy for the current user scope, execute the following command in PowerShell and press the Y key to confirm:

PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- sample output -
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust.
Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

To change the execution policy for all users, start PowerShell as administrator and run the command below:

PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

To start PowerShell as administrator, press ⊞ Win keybutton to open the Start menu, type in powershell to search for Windows PowerShell and press Ctrl + Shift + Enter.

Changing the execution policy to RemoteSigned should solve the issue and prevent the error message “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.” from appearing again.

Was it useful? Share this post with the world!

Leave a Reply