-
Bug
-
Resolution: Fixed
-
Critical
-
None
When Powershell-plugin 1.4 creates a temp Powershell script file, it inserts a new line of code as the first line of the file. The new line is either,
$ErrorActionPreference="Continue" (When "Stop on Errors" option is unchecked)
or,
$ErrorActionPreference="Stop" (When "Stop on Errors" option is checked)
This insertion breaks original code with param() because it must be the first line. An exception was thrown saying, "The term 'param' is not recognized as the name of a cmdlet, function, script file, or operable program.".
The "ErrorActionPreference" line should be taken off, code developers can certainly manage it by themselves. Or, it should be inserted after the param() block.
- is duplicated by
-
JENKINS-60423 Powershell fails when the script starts with 'CmdletBinding' attribut
- Resolved