error:
e[91mparam: e[0m/tmp/jenkins8171739391719656217.ps1:2
e[96mLine |
e[96m 2 | e[0m e[96mparame[0m (
e[96m | e[91m ~~~~~
e[91me[96m | e[91mThe term ‘param’ is not recognized as a name of a cmdlet,
e[96m | e[91mfunction, script file, or executable program. Check the
e[96m | e[91mspelling of the name, or if a path was included, verify that
e[96m | e[91mthe path is correct and try again.
e[0m
Build step ‘PowerShell’ marked build as failure
Finished: FAILURE
Even if the PowerShell plugin were corrected to make Param work in scripts again, it still would not automatically translate Jenkins build parameters to PowerShell script parameters. I think PowerShell might then prompt for parameter values and hang the build.
If you were instead using a pipeline with “powershell” or “pwsh” steps, then you could alternatively use the ‘${params.NAME}’ syntax to make Jenkins substitute the parameter values into the script. This however looks less safe than environment variables, because if the parameter value itself contains a quotation mark or a backtick, then that can interfere with how PowerShell parses the script.