We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11745b1 commit 4443654Copy full SHA for 4443654
1 file changed
eng/common/scripts/Helpers/CommandInvocation-Helpers.ps1
@@ -54,6 +54,15 @@ function Invoke-LoggedCommand
54
if($LastExitCode -notin $AllowedExitCodes)
55
{
56
LogError "Command failed to execute ($duration): $Command`n"
57
+
58
+ # This fix reproduces behavior that existed before
59
+ # https://github.com/Azure/azure-sdk-tools/pull/12235
60
+ # Before that change, if a command failed Write-Error was always
61
+ # invoked in the failure case. Today, LogError only does Write-Error
62
+ # when running locally (not in a CI environment)
63
+ if ((Test-SupportsDevOpsLogging) -or (Test-SupportsGitHubLogging)) {
64
+ Write-Error "Command failed to execute ($duration): $Command`n"
65
+ }
66
}
67
else {
68
Write-Host "Command succeeded ($duration)`n"
0 commit comments