Jenkins will randomly not execute batch files as part of the build. In the failing case I get a message like :
*18:01:43* C:\JenkinsHome\Slave\workspace\Job1>exit 2 *18:01:44* Build step 'Execute Windows batch command' marked build as failure In the successful case I get *11:40:37* C:\JenkinsHome\Slave\workspace\Job1l>exit 0 *11:40:37* [SrcInfrastructureYellowSql] $ powershell.exe "& 'C:\Users\#Jenkins\AppData\Local\Temp\hudson5725866031798325048.ps1'"*11:40:53* [SrcInfrastructureYellowSql] $ cmd /c call C:\Users\#Jenkins\AppData\Local\Temp\hudson2668871926239131897.bat*11:40:53* *11:40:53* C:\JenkinsHome\Slave\workspace\Job1>powershell.exe "& {C:\JenkinsHome\Slave\workspace\Job1\Job2\script.ps1; exit $lastexitcode}" It seems as though the powershell session is not able to be started? Any hints on this?