jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-56925] extra newline character from powershell output

Open
#455 3 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue priority:trivial resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

When i trying to wrap some powershell script output into variable, it's adds excess \n symbol to.

Like:

script {

VARI = powershell (returnStdout: true, script: """Write-Output foo""")
println VARI
}

It's outputs the following:

[Pipeline] script

[Pipeline] {
[Pipeline] powershell
[Pipeline] echo
foo

[Pipeline] }
[Pipeline] // script
[Pipeline] }


But powershell itself transmits output without `n .

How to escape it in output?

---
Originally reported by gek, imported from: extra newline character from powershell output


  • assignee: gek
  • status: Open
  • priority: Trivial
  • component(s): durable-task-plugin
  • label(s): jenkins,pipeline,powershell
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 2025-12-09

Raw content of original issue

When i trying to wrap some powershell script output into variable, it's adds excess \n symbol to.

Like:



script {

VARI = powershell (returnStdout: true, script: """Write-Output foo""")
println VARI
}


It's outputs the following:



[Pipeline] script

[Pipeline] {
[Pipeline] powershell
[Pipeline] echo
foo

[Pipeline] }
[Pipeline] // script
[Pipeline] }



But powershell itself transmits output without `n .
How to escape it in output?

environment

```
Jenkins ver. 2.164.1

Durable Task Plugin 1.29
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.