How to run a PowerShell script as a job in Jenkins How to run a PowerShell script as a job in Jenkins powershell powershell

How to run a PowerShell script as a job in Jenkins


Well, there is a PowerShell plugin, which is wrapping the shell anyway. I use this on my server, executing scripts in standard notation:

powershell -File test001.ps1

It works without any quirks.


I found the problem came down to PowerShell managing the execution policy separately for 32-bit and 64-bit versions. Checkout http://www.gregorystrike.com/2011/01/27/how-to-tell-if-powershell-is-32-bit-or-64-bit/ to try launching both. Run Get-ExecutionPolicy in both and you will see they are different.

At least with version 1.4, it appears the plugin ends up using the 32-bit process.