Jenkins won’t run Start-Job with Credential parameter

Question:

I pass in credentials to the script via the env injector (note this works for me with Invoke-Command) and try to run Start-Job but jenkins doesn’t like it:

This is the error I get (confirmed username and password are correct, when I run this script from the console with the same creds it works)

Answer:

i’ve had issues with credentials at times with PowerShell, i can usually fix it by using this:

Basically entering the credentials into Get-credentials, then using that for credentials.

Source:

Jenkins won’t run Start-Job with Credential parameter by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply