Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
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
Description
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"'
Attachments
Issue Links
- mentioned in
-
Page Loading...
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | durable-task-plugin [ 18622 ] | |
Component/s | workflow-durable-task-step-plugin [ 21715 ] | |
Component/s | pipeline-stage-step-plugin [ 21709 ] |
Remote Link | This issue links to "Page (Jenkins Wiki)" [ 18024 ] |
Assignee | Gabriel Loewen [ gabloe ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | 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 | Fixed [ 1 ] | |
Status | In Review [ 10005 ] | Closed [ 6 ] |
That bug really harm us during upgrade. I wanted to move most powershell scripts to SharedLibrary, any workaround for that?