Open mikeharder opened 4 months ago
Hi @mikeharder, Thanks for reporting the issue. Could you please share the debug logs of the pipeline by adding variable system.debug to "true"?
@v-schhabra: I'm not comfortable sharing full debug logs due to potentially sensitive information. I have provided a minimal pipeline you can use to reproduce the problem, and I have already shared the relevant debug logs.
The AzureCLI@2
task has a specific affordance for this scenario (powerShellIgnoreLASTEXITCODE
) which is similar to behavior in PowerShell@2
(ignoreLASTEXITCODE
)
Given this, it looks like AzurePowerShell@5
differs from other similar tasks.
New issue checklist
Task name
AzurePowerShell
Task version
5.239.10
Issue Description
AzurePowerShell@5 should fail if $LASTEXITCODE is nonzero. PowerShell@2 handles this correctly.
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Ubuntu 22.04
Relevant log output
Full task logs with system.debug enabled
No response
Repro steps
Workaround
As a workaround, you can add
exit $LASTEXITCODE;
to the end of the inline script:But I still think this is a bug in AzurePowerShell, for two reasons:
I still think this is a bug in AzurePowerShell, because: