From f72b7a85c7fde3007f51df66879947160d9304d8 Mon Sep 17 00:00:00 2001 From: Yuriy-Kukushkin <87432006+Yuriy-Kukushkin@users.noreply.github.com> Date: Fri, 3 Sep 2021 11:55:56 +0300 Subject: [PATCH] Update manifest-validator.ps1 --- packages-generation/manifest-validator.ps1 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages-generation/manifest-validator.ps1 b/packages-generation/manifest-validator.ps1 index 7266e11..6e82ae7 100644 --- a/packages-generation/manifest-validator.ps1 +++ b/packages-generation/manifest-validator.ps1 @@ -3,6 +3,7 @@ param ( [string] $AccessToken ) +$Global:validationFailed = $false $authorizationHeaderValue = "Basic $AccessToken" $webRequestHeaders = @{} if ($AccessToken) { @@ -14,9 +15,13 @@ function Publish-Error { [string] $ErrorDescription, [object] $Exception ) - Write-Host "##vso[task.logissue type=error]ERROR: $ErrorDescription." - Write-Host "##vso[task.logissue type=error] $Exception" - Write-Host "##vso[task.complete result=Failed;]" + + echo "::error ::$ErrorDescription" + if(-not [string]::IsNullOrEmpty($Exception)) + { + Write-Output "Exception: $Exception" + } + $Global:validationFailed = $true } function Test-DownloadUrl { @@ -61,3 +66,8 @@ $manifestJson | ForEach-Object { } } } + +if($Global:validationFailed) +{ + exit 1 +}