Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid syntax on multiple lines #695

Open
colt64 opened this issue Oct 8, 2024 · 2 comments
Open

Invalid syntax on multiple lines #695

colt64 opened this issue Oct 8, 2024 · 2 comments

Comments

@colt64
Copy link

colt64 commented Oct 8, 2024

Line 522 of PrePostDeploymentScript.Ver2.ps1 contains a ternary if, which is not valid powershell syntax:

$parameterType = $null -ne $templateParameters.$($parameterName).value ? $templateParameters.$($parameterName).value.GetType().Name : $null

Line 521 contains && instead of -and and || instead of -or

if ($null -ne $templateParameters.$($parameterName) && ($PreDeployment || $parameterName.EndsWith('runtimeState'))) {

These cause errors when running in a pipeline. Easy fix but needs to be corrected. If I can find time will submit a PR but hope you get to it first.

@colt64
Copy link
Author

colt64 commented Oct 8, 2024

my mistake, the ternary operation is valid in powershell 7.0 but not all versions. For example, the one on my release server.

@bulrush15
Copy link

Are you able to update Powershell on your release server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants