Grasping at straws here late at night -
1. Do you have multiple builds running in separate agents at the same
time, or just one agent active? Do you have anything else running
that might be using powershell at the same time? I've not used it so
I don't know how it works if you try and spawn multiple powershell
sessions at the same time.
2. It looks like you're calling
C:\JenkinsHome\Slave\workspace\Job1\Job2\script.ps1 in a successful
run. Does that file/path exist in situations when it fails? It seems
a bit odd that it's Job1\Job2 in the path, but perhaps that is as
intended.
3. Is there anything within the powershell script itself (script.ps1)
that might be returning an exit code of 2? By default, from what
Google is telling me, powershell defaults to returning either 0
(success) or 1 (failure). Unless I'm not finding accurate information
(which is entirely possible), I'm wondering if something else is
kicking it to a 2 exit code other than powershell itself.
-Scott
On Thu, Aug 9, 2012 at 10:21 PM, j.barrett strausser