Enable execution of PowerShell scripts

Have you encountered an error message saying “File cannot be loaded because running scripts is disabled on this system” when trying to run a PowerShell script? Here’s how to fix it.

Requirements

You need to be a local administrator or have the administrator credentials.

Solution

Open PowerShell as an administrator (Right click PowerShell in the start menu -> Choose “Run as administrator”).

Run the following command:

Set-ExecutionPolicy RemoteSigned

This will allow you to run all scripts created by yourself and all scripts downloaded from the Internet that are remote signed. If you still encounter issues when running PowerShell scripts you can always set the execution policy to unrestricted in order to allow all scripts to run, but this is generally not advised for security reasons. However, run this command instead of the one above to set it to unrestricted: