Created a CD with few steps starting from "Azure PowerShell Task".
In Azure PowerShell tasks, executing a PowerShell script file and set a value in a variable. At the end of the script I have set the variable with a value –
echo "##vso[task.setvariable variable=myvariable;isSecret=false;isOutput=true;]myvalue"
myvariable is the variable
myvalue is the value.
Based on the value of “myvariable”; downstream task will be executed or skipped. Mentioned "Custom Condition" in downstream task (Task - Azure Create or Update Resource) –
and(succeeded(), eq(variables[‘myvariable’], ‘myvalue’))
But, it’s always skipping the step; despite the correct value is passing. Here is my release tasks snippet -

How do I overcome?

echowithWrite-Host?$env:myvariable. also try your condition like so:$(myvariable), myvalue. also, worth nothing, you are probably trying to do something you are not supposed to do with this approach