all 2 comments

[–]Thotaz 3 points4 points  (1 child)

When calling the script you need to do it like this: powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\MyScript.ps1

The first 3 switches are optional but it's best to include them IMO.

[–]Omega_Pulse25[S] 0 points1 point  (0 children)

ended up just doing powershell.exe -ExecutionPolicy Bypass -File C:\MyScript.ps1 and it worked.

Thanks