Aug 28, 2013

How to run Windows PowerShell scripts

The default PowerShell execution policy prevents running any scripts. You need to change it to Unrestricted with the following command:

Set-ExecutionPolicy Unrestricted

Then you can just right-click the .ps1 file and choose Run with PowerShell, or you can run it from within the PowerShell prompt:

PS> cd C:\path_to_my_script\
PS> .\script.ps1


Source

No comments:

Post a Comment