-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins 2.60.2
Windows Server 2012 R2
PSVersion 5.1.15063.502
Plugins:
Powershell 1.3
Pipeline: Build Step 2.5.1
Pipeline 2.5
Powershell step in pipeline outputs UTF-8 BOM characters with Powershell output.
[workspace] Running PowerShell script Hello
If I run the same command (Write-Host "Hello") in a usual build job as a Powershell step it outputs normal output:
[workspace] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Users\VALERY~1.ZAB\AppData\Local\Temp\jenkins2440165524934484537.ps1'"
Hello
Finished: SUCCESS
Here's my powershell step code:
powershell 'Write-Host "Hello"'
- mentioned in
-
Page Failed to load
[JENKINS-46496] Powershell step in pipeline job outputs UTF-8 BOM
Component/s | New: durable-task-plugin [ 18622 ] | |
Component/s | New: workflow-durable-task-step-plugin [ 21715 ] | |
Component/s | Original: pipeline-stage-step-plugin [ 21709 ] |
Remote Link | New: This issue links to "Page (Jenkins Wiki)" [ 18024 ] |
Assignee | New: Gabriel Loewen [ gabloe ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Comment |
[ {code:java} C:\CI\Jenkins\...@tmp\durable-f7d18e60\powershellWrapper.ps1 : You cannot call a method on a null-valued expression. At C:\CI\Jenkins\...@tmp\durable-f7d18e60\powershellHelper.ps1:30 char:7 + & $MainScript *>&1 | Out-FileNoBom -FilePath $LogFile; $LastExi ... + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,powershellWrapper.ps1{code} I get above error when passing to ps script parameter with space eq 95f9a9463de59ce3f9f5807643ab32feaffa30ad refs/heads/master (passed to -commitHash) {code:java} powershell(script: """ . .\\scripts\\artifactsPicker.ps1 -storageAccountName $storageAccount ` -branchName $pipelineParams.branchName ` -packageParameters "$packageParameters" ` -buildNewPackage $pipelineParams.buildNewPkg ` -commitHash "$getLastPackageHash" ` """){code} Script was working o 1.15, failure since I update to 1.17 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Review [ 10005 ] | New: Closed [ 6 ] |