File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
.azure-pipelines/PipelineSteps Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ param (
1616 [string ]$PowerShellPlatform
1717)
1818
19+ function Assert-ExitCodeSuccess {
20+ param (
21+ [string ]$Operation = " Command"
22+ )
23+ if (($LASTEXITCODE -ne 0 ) -and ($LASTEXITCODE -ne $null )) {
24+ Write-Error " $Operation failed with exit code $LASTEXITCODE "
25+ exit $LASTEXITCODE
26+ }
27+ }
28+
1929# Install PowerShell dependencies
2030Write-Host - ForegroundColor Green " -------------------- Start installing PowerShell dependencies ... --------------------"
2131Install-Module " platyPS" , " PSScriptAnalyzer" - Repository PSGallery - Force - Confirm:$false - Scope CurrentUser
@@ -36,9 +46,11 @@ if ($PowerShellPlatform) {
3646}
3747$buildProjPath = Join-Path $RepoRoot ' build.proj'
3848dotnet msbuild $buildProjPath / t:GenerateHelp " /p:Configuration=$Configuration "
49+ Assert-ExitCodeSuccess - Operation " Help generation"
3950Write-Host - ForegroundColor DarkGreen " -------------------- End generating help ... --------------------`n`n`n`n`n "
4051
4152# Static Analysis
4253Write-Host - ForegroundColor Green " -------------------- Start static analysis ... --------------------"
4354dotnet msbuild $buildProjPath / t:StaticAnalysis " /p:Configuration=$Configuration "
55+ Assert-ExitCodeSuccess - Operation " Static analysis"
4456Write-Host - ForegroundColor DarkGreen " -------------------- End static analysis ... --------------------`n`n`n`n`n "
You can’t perform that action at this time.
0 commit comments