Azure / Azure/Azure-DataFactory

Error running PrePostDeploymentScript.Ver2.ps1 and PrePostDeploymentScript.Ver1.ps1 in azure devops agent

Open
#627 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
529
Forks
623
PR merge metrics
No merged PRs in 30d

Description

Hello I am getting this errors while running the pre-postdeployment script in my azure devops agent.
At D:\a\r1\a\_azure-data-factory\cicd.ps1:489 char:84
+ ... ype = $null -ne $templateParameters.$($parameterName).value ? $templa ...
+ ~
Unexpected token '?' in expression or statement.
At D:\a\r1\a\_azure-data-factory\cicd.ps1:488 char:61
+ ... if ($null -ne $templateParameters.$($parameterName) && ($PreDe ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At D:\a\r1\a\_azure-data-factory\cicd.ps1:488 char:80
+ ... e $templateParameters.$($parameterName) && ($PreDeployment || $parame ...
+ ~~
The token '||' is not a valid statement separator in this version.
PowerShell exited with code '1'.
Here is how it looks on screen:
![Screenshot (631)](https://github.com/Azure/Azure-DataFactory/assets/101653234/3c5196a4-bad5-4de4-a667-8e4ee177ecd8)
I use the latest powershell version and chose **Use Powershell Core** yet, the error would not got away. I stepped down to use PrePostDeploymentScript.Ver1.ps1, it was the same error. Could you please advise on what I should do? I am afraid removing the characters flagged as causes of error will cause the script not to function as intended.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.