This is a reminder for myself: “powershell.exe -File test.ps1 -ExecutionPolicy Bypass” doesn’t work.
“File C:\Demo\hello.ps1 cannot be loaded because running scripts is disabled on this system.”
It’s because of this:
-ExecutionPolicy Bypass is not parsed as an option, but as arguments to option -File.
The correct option order is this:
powershell.exe -ExecutionPolicy Bypass -File hello.ps1
[…] Quickpost: PowerShell Options Order […]
Pingback by Overview of Content Published In August | Didier Stevens — Wednesday 6 September 2017 @ 19:54