From fa4964171990762315b9c1ad5f2406362d4b0fe0 Mon Sep 17 00:00:00 2001 From: "Nikolai Frolov (Akvelon INC)" Date: Tue, 12 Oct 2021 16:00:52 +0300 Subject: [PATCH] Minor code improvement according to comments --- packages-generation/manifest-validator.ps1 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages-generation/manifest-validator.ps1 b/packages-generation/manifest-validator.ps1 index bb64643..043eca5 100644 --- a/packages-generation/manifest-validator.ps1 +++ b/packages-generation/manifest-validator.ps1 @@ -4,11 +4,6 @@ param ( ) $Global:validationFailed = $false -$authorizationHeaderValue = "Basic $AccessToken" -$webRequestHeaders = @{} -if ($AccessToken) { - $webRequestHeaders.Add("Authorization", $authorizationHeaderValue) -} function Publish-Error { param( @@ -16,7 +11,7 @@ function Publish-Error { [object] $Exception ) - echo "::error ::$ErrorDescription" + Write-Output "::error ::$ErrorDescription" if (-not [string]::IsNullOrEmpty($Exception)) { Write-Output "Exception: $Exception" @@ -26,6 +21,7 @@ function Publish-Error { function Test-DownloadUrl { param([string] $DownloadUrl) + $authorizationHeaderValue = "Basic $AccessToken" $request = [System.Net.WebRequest]::Create($DownloadUrl) if ($AccessToken) { $request.Headers.Add("Authorization", $authorizationHeaderValue)