From 359c2548cb61c09363a4be0f820f19ae34ddaba5 Mon Sep 17 00:00:00 2001 From: "Nikolai Frolov (Akvelon INC)" Date: Tue, 12 Oct 2021 17:19:45 +0300 Subject: [PATCH] Minor code improvement according to comments --- packages-generation/manifest-validator.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages-generation/manifest-validator.ps1 b/packages-generation/manifest-validator.ps1 index 043eca5..e2fd71c 100644 --- a/packages-generation/manifest-validator.ps1 +++ b/packages-generation/manifest-validator.ps1 @@ -20,10 +20,10 @@ function Publish-Error { } function Test-DownloadUrl { - param([string] $DownloadUrl) - $authorizationHeaderValue = "Basic $AccessToken" + param([string] $DownloadUrl) $request = [System.Net.WebRequest]::Create($DownloadUrl) if ($AccessToken) { + $authorizationHeaderValue = "Basic $AccessToken" $request.Headers.Add("Authorization", $authorizationHeaderValue) } try { @@ -41,7 +41,7 @@ if (-not (Test-Path $ManifestPath)) { Write-Host "Parsing manifest json content from '$ManifestPath'..." try { - $manifestJson = $( Get-Content $ManifestPath ) | ConvertFrom-Json + $manifestJson = Get-Content $ManifestPath | ConvertFrom-Json } catch { Publish-Error "Unable to parse manifest json content '$ManifestPath'" $_ exit 1