Jenkins is running as "Local Service" on Windows Server 2019.
The script with Start-Job in it runs fine when run from a PowerShell prompt on the same machine. The issue only occurs when Jenkins runs the PowerShell script.
The workaround that Michal Zatloukal suggested does not work for me.
I'm kind of at a loss here. If anyone has any suggestions how I could help debug this issue, please let me know.
I'm encountering the exact same issue. Some additional information that may help to narrow this down:
* It is invoked as follows: {code:java} $job =Start-Job -Credential $cred -ArgumentList ($arg1, $arg2) -ScriptBlock { } $job | Receive-Job -AutoRemoveJob -Wait{code}
Where $cred is a PSCredential.
* Jenkins is running as "Local Service" on Windows Server 2019. * The script with Start-Job in it runs fine when run from a PowerShell prompt on the same machine. The issue only occurs when Jenkins runs the PowerShell script. * The workaround that [~myxal] suggested does not work for me.
I'm kind of at a loss here. If anyone has any suggestions how I could help debug this issue, please let me know.
I'm currently working around this issue by using Invoke-Command instead, and allowing PowerShell Remoting sessions with CredSSP authentication on localhost from localhost.