Powershell – PSSecurityException when executing a PS1 script file

SCENARIO

When I try to execute my PowerShell script I get this error:

File C:\Common\Scripts\hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:13
+ .\hello.ps1 <<<<
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException

SOLUTION

Open a Powershell Command Shell:

Enable running unsigned scripts by entering (press Enter):

set-executionpolicy remotesigned

This will allow running unsigned scripts that you write on your local computer and signed scripts from Internet.

SOURCE

LINK

LANGUAGE
ENGLISH