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

Veve
  • 6,643
  • 5
  • 39
  • 58
zuri_nahk
  • 21
  • 2
  • 4
  • The way you call it seems correct to me. Could you try replacing the powershell script with something simple like ls? – smelm Sep 18 '20 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. – zuri_nahk Sep 18 '20 at 10:45
  • I have almost the same problem: it works outside of the script but not within the script! – Srđan Popić Nov 26 '20 at 13:22
  • This solution worked for me https://stackoverflow.com/a/42576572 – zuri_nahk Dec 07 '20 at 06:43

0 Answers0