Answer the question
In order to leave comments, you need to log in
Why is Powershell script not working from another user in Jenkins?
Hello! There was a task to run the program on behalf of another user, but, unfortunately, I ran into a problem that the script does not work. No errors are output, just bare console output in Jenkins. Where can I see the log what's wrong?
Stage('Test SSO') {
steps {
powershell label: '', script: '''
\$securePassword = ConvertTo-SecureString \'Password\' -AsPlainText -Force
\$credential = New-Object System.Management.Automation.PSCredential .\\local_login , \$securePassword
Start-Process \'whoami.exe\' -Credential \$credential
'''
}
}
Answer the question
In order to leave comments, you need to log in
Powershell never won... they wrote a console utility that takes a login, a password from whom to run and a path to run as input. Next, it launches and normally prints the entire console output...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question