Powershell Running Scripts (PS1) Error

When running some ps1 file in Powershell and you get some error like:

File <Path-to-some-ps1-file>.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.

You can solve it by running the following command in Powershell:

Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "RemoteSigned"

To reset the policy setting run:

Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "AllSigned"

Cheers!.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s