Attempting to run a PowerShell script I got the following error:
File C:\Work\ps.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
To run PowerShell scripts (files that end with .ps1), you must set the execution policy to Unrestricted. This is done by issuing the following command in powersehll
*note* you need to do this in a elevated powershell (run it as administrator)
Once you do that, Windows will allow you to execute any .ps1 file.