Quantcast
Viewing latest article 8
Browse Latest Browse All 10

Allow custom Powershell scripts to run

When creating your own Powershell scripts when you first try to run them you will get the following error:

File C:\script.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:21 + .\script.psa + CategoryInfo : NotSpecified: (:) [], PSSecurityException + FullyQualifiedErrorId : RuntimeException

This is because the default Powershell Execution Policy is set to only allow signed scripts.

So to create your own scripts and run them on your system I usually set the Execution Policy to Unrestricted:

 

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force

Warning this will allow all powershell scripts to be run even those you may not want running so only do this if you are sure the computer is secure enough to do so.

The post Allow custom Powershell scripts to run appeared first on Tom's Blog.


Viewing latest article 8
Browse Latest Browse All 10

Trending Articles