Update manifest-validator.ps1

pull/36/head
Yuriy-Kukushkin 3 years ago committed by GitHub
parent 3d09ce1d19
commit f72b7a85c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,7 @@ param (
[string] $AccessToken [string] $AccessToken
) )
$Global:validationFailed = $false
$authorizationHeaderValue = "Basic $AccessToken" $authorizationHeaderValue = "Basic $AccessToken"
$webRequestHeaders = @{} $webRequestHeaders = @{}
if ($AccessToken) { if ($AccessToken) {
@ -14,9 +15,13 @@ function Publish-Error {
[string] $ErrorDescription, [string] $ErrorDescription,
[object] $Exception [object] $Exception
) )
Write-Host "##vso[task.logissue type=error]ERROR: $ErrorDescription."
Write-Host "##vso[task.logissue type=error] $Exception" echo "::error ::$ErrorDescription"
Write-Host "##vso[task.complete result=Failed;]" if(-not [string]::IsNullOrEmpty($Exception))
{
Write-Output "Exception: $Exception"
}
$Global:validationFailed = $true
} }
function Test-DownloadUrl { function Test-DownloadUrl {
@ -61,3 +66,8 @@ $manifestJson | ForEach-Object {
} }
} }
} }
if($Global:validationFailed)
{
exit 1
}

Loading…
Cancel
Save