Minor code improvement according to comments

This commit is contained in:
Nikolai Frolov (Akvelon INC)
2021-10-12 17:19:45 +03:00
parent fa49641719
commit 359c2548cb

View File

@@ -21,9 +21,9 @@ function Publish-Error {
function Test-DownloadUrl {
param([string] $DownloadUrl)
$authorizationHeaderValue = "Basic $AccessToken"
$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