Azure / Azure/Azure-DataFactory
Error running PrePostDeploymentScript.Ver2.ps1 and PrePostDeploymentScript.Ver1.ps1 in azure devops agent
- 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:

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
Assessment
This issue has not been assessed yet.