-
Bug
-
Resolution: Not A Defect
-
Minor
-
Jenkins 2.332.3
Powershell Jenkins plugin 1.7
Hi there,
I'm trying to run a PS script from a github repo that accept parameters through param() but when I try to pass them with jenkins it fails. I have created a very basic script to prove this. When I call the script withouth parameters it works as espected, but when I try to call it passing one parameter it fails:
[copla-cli-test0] $ powershell.exe -NonInteractive -ExecutionPolicy Bypass -File C:\Windows\TEMP\jenkins5348470450205503128.ps1
. : The term 'C:\Windows\Temp\Jenkins\workspace\copla-cli-test0\hellow.ps1 testmessage' 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,
I have managed to have it working copying the script code in the jenkin's powershell textbox and referencing parameter as $env:parameter but this is not what I need, since we are developing powershell scripts in github I need to call the script something like this:
. "$ENV:WORKSPACE\hellow.ps1 $env:message"
I have read something simillar in other Jira issues but didn't helped me much. Is there something I'm missing with powhershell or jenkins? both worlds are relativily new to me.
Thanks in advance!