Jenkins execute PowerShell scripts Jenkins execute PowerShell scripts powershell powershell

Jenkins execute PowerShell scripts


After more than two hours of pulling my hair, the problem was x86/x64!!!

Turns out, Set-ExecutionPolicy of x64 (default) PowerShell has no effect on the x86 settings!

Jenkins is a 32-bit process, running from a Windows service - it executes the x86 PowerShell!

In addition, the Modules directory for x86 PowerShell is located under %systemroot%\SysWow64\WindowsPowerShell\1.0\Modules, another important fact to remember!