I am using jenkins pipeline with latest LTS version and, even if I pass returnStdout.
I tried:
powershell 'Write-Host \'Hello World!\''
and
powershell returnStdout: true, script: 'Write-Host \'Hello World!\''
When I create a normal free-style job with a Windows PowerShell step, it works:
[test] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Windows\TEMP\jenkins1262538438885300795.ps1'"
Hello World!
How can I get the same behavior using a declarative pipeline?
Thanks,
Thiago D'Ávila