1

I want to run Powershell script on agent from Jenkins declarative pipeline. It hangs on the script execution step (click on Job logs) and i have to forcefully exit it. What is the correct way to execute powershell script from pipeline and also so that it show output in console. I have gone through many solutions but no success yet.

Some useful snippets:

Pipeline code

Job logs

4
  • The way you call it seems correct to me. Could you try replacing the powershell script with something simple like ls? Commented Sep 18, 2020 at 10:24
  • 1
    @smelm when i do ls inline e.g powershell script: 'ls' it gives me expected output but when executing ls from file, nothing prints on console. Commented Sep 18, 2020 at 10:45
  • I have almost the same problem: it works outside of the script but not within the script! Commented Nov 26, 2020 at 13:22
  • This solution worked for me stackoverflow.com/a/42576572 Commented Dec 7, 2020 at 6:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.