Skip to content

Commit f9feeb2

Browse files
authored
Update the logic of LastExitCode (#22491)
1 parent 6b1d48a commit f9feeb2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tools/ExecuteCIStep.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -397,37 +397,37 @@ If ($StaticAnalysis)
397397
$FailedTasks = @()
398398
$ErrorLogPath = "$StaticAnalysisOutputDirectory/error.log"
399399
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisBreakingChange @Parameters 2>$ErrorLogPath
400-
If ($LASTEXITCODE -ne 0)
400+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
401401
{
402402
$FailedTasks += "BreakingChange"
403403
}
404404
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisDependency @Parameters 2>>$ErrorLogPath
405-
If ($LASTEXITCODE -ne 0)
405+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
406406
{
407407
$FailedTasks += "Dependency"
408408
}
409409
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisSignature @Parameters 2>>$ErrorLogPath
410-
If ($LASTEXITCODE -ne 0)
410+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
411411
{
412412
$FailedTasks += "Signature"
413413
}
414414
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisHelp @Parameters 2>>$ErrorLogPath
415-
If ($LASTEXITCODE -ne 0)
415+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
416416
{
417417
$FailedTasks += "Help"
418418
}
419419
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisUX @Parameters 2>>$ErrorLogPath
420-
If ($LASTEXITCODE -ne 0)
420+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
421421
{
422422
$FailedTasks += "UXMetadata"
423423
}
424424
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisCmdletDiff @Parameters 2>>$ErrorLogPath
425-
If ($LASTEXITCODE -ne 0)
425+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
426426
{
427427
$FailedTasks += "CmdletDiff"
428428
}
429429
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisGeneratedSdk @Parameters 2>>$ErrorLogPath
430-
If ($LASTEXITCODE -ne 0)
430+
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
431431
{
432432
$FailedTasks += "GenertedSdk"
433433
}
@@ -437,7 +437,7 @@ If ($StaticAnalysis)
437437
$ErrorLog = Get-Content -Path $ErrorLogPath | Join-String -Separator "`n"
438438
Write-Error $ErrorLog
439439
}
440-
Return
440+
Return 0
441441
}
442442

443443
If ($StaticAnalysisBreakingChange)
@@ -459,7 +459,7 @@ If ($StaticAnalysisBreakingChange)
459459
Return $LASTEXITCODE
460460
}
461461
}
462-
Return
462+
Return 0
463463
}
464464
If ($StaticAnalysisDependency)
465465
{
@@ -481,7 +481,7 @@ If ($StaticAnalysisDependency)
481481
}
482482
.($PSScriptRoot + "/CheckAssemblies.ps1") -BuildConfig $Configuration
483483
}
484-
Return
484+
Return 0
485485
}
486486

487487
If ($StaticAnalysisSignature)
@@ -503,7 +503,7 @@ If ($StaticAnalysisSignature)
503503
Return $LASTEXITCODE
504504
}
505505
}
506-
Return
506+
Return 0
507507
}
508508

509509
If ($StaticAnalysisHelp)
@@ -525,7 +525,7 @@ If ($StaticAnalysisHelp)
525525
Return $LASTEXITCODE
526526
}
527527
}
528-
Return
528+
Return 0
529529
}
530530

531531
If ($StaticAnalysisUX)
@@ -547,7 +547,7 @@ If ($StaticAnalysisUX)
547547
Return $LASTEXITCODE
548548
}
549549
}
550-
Return
550+
Return 0
551551
}
552552

553553
If ($StaticAnalysisCmdletDiff)
@@ -569,7 +569,7 @@ If ($StaticAnalysisCmdletDiff)
569569
Return $LASTEXITCODE
570570
}
571571
}
572-
Return
572+
Return 0
573573
}
574574

575575
If ($StaticAnalysisGeneratedSdk)
@@ -592,5 +592,5 @@ If ($StaticAnalysisGeneratedSdk)
592592
Return $LASTEXITCODE
593593
}
594594
}
595-
Return
595+
Return 0
596596
}

0 commit comments

Comments
 (0)