-
Bug
-
Resolution: Fixed
-
Major
-
-
powershell-1.8
Hi,
Since upgrade to the latest version of PowerShell Plugin (1.4) a lot of my scripts does not work any more.
Especially when inline or script files starts with the 'CmdletBinding' attribut.
[workspace] $ powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File C:\Users\ATHICS~1\AppData\Local\Temp\jenkins8862236051379677851.ps1
Au caractŠre C:\Users\AthicService\AppData\Local\Temp\jenkins8862236051379677851.ps1:3 : 1
+ [CmdletBinding()]
~+ ~~~~~~~~~~~~~~~~~~
Attribut inattendu ®ÿCmdletBindingÿ¯.
Au caractŠre C:\Users\AthicService\AppData\Local\Temp\jenkins8862236051379677851.ps1:4 : 1
+ param([switch]$Elevated
~+ ~~~~~~
Jeton inattendu ®ÿparamÿ¯ dans l'expression ou l'instruction.
+ CategoryInfo : ParserError: ( [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedAttribute
Build step 'PowerShell' marked build as failure
As I have a lot of PS scripts like that, I have to downgrade to 1.3 version.
- duplicates
-
JENKINS-63153 Jenkins powershell-plugin 1.4 breaks code with param()
-
- Closed
-
Hi froque,
I'm using the Standard PowerShell arguments, like -ErrorAction and -Verbose in my scripts that are set up before the call from Jenkins (as constants or as Jenkins Job parameter).
For exemple, the -ErrorAction is sometimes "Stop" or "SilentlyContinue", depending of a given need.
And a script might be called outside Jenkins.
What changed between 1.3 and 1.4 version that causes this issues ?