-
Bug
-
Resolution: Unresolved
-
Minor
-
Jenkins 2.73.3 on Windows Server 2012 R2
Jenkins 2.93 on Windows 10 Enterprise
When creating a job with a space in the name the "powershell" step in a pipeline will hang.
Steps to reproduce:
- Create a Pipeline with a space in the name (e.g. "A Space").
- Paste in the following pipeline script:
pipeline {
agent any
stages {
stage ("Stage 1") {
steps {
powershell 'Write-Output "Hello world!"'
}}}} - Run the build and see it hang on the PowerShell step.
It looks like it's due to the use of nested double quotes in the command that's called by the plugin, so it's probably ending the string at the wrong point. I copied the generated PowerShell scripts and tried to execute the command myself and got an error only when spaces and double quotes were used.
Manual attempt:
U:\Build Dir>powershell.exe -noninteractive -executionpolicy bypass -command ". "U:\Build Dir\Helper.ps1"; execute-andwriteoutput -mainscript "U:\Build Dir\test.ps1" -logfile "U:\Build Dir\test_log.txt" -resultfile "U:\Build Dir\test_result.txt";"
. : The term 'U:\Build' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ . U:\Build Dir\Helper.ps1; execute-andwriteoutput -mainscript U:\Bui ...
+ ~~~~~~~~
{{ + CategoryInfo : ObjectNotFound: (U:\Build:String) [], CommandNotFoundException}}
{{ + FullyQualifiedErrorId : CommandNotFoundException}}execute-andwriteoutput : The term 'execute-andwriteoutput' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:29
+ . U:\Build Dir\Helper.ps1; execute-andwriteoutput -mainscript U:\Bui ...
+ ~~~~~~~~~~~~~~~~~~~~~~
{{ + CategoryInfo : ObjectNotFound: (execute-andwriteoutput:String) [], CommandNotFoundException}}
{{ + FullyQualifiedErrorId : CommandNotFoundException}}
- is duplicated by
-
JENKINS-48325 Powershell step hangs indefinitely.
- Closed