Here's a couple of alternatives to setting the execution policy to Unrestricted:
Powershell.exe –noprofile –executionpolicy bypass –file "C:\Scripts\myScript.ps1"
Get-Content 'C:\Scripts\myScript.ps1' | powershell.exe -noprofile -
(The minus (-) is important!)
No comments:
Post a Comment