Minor code improvement according to comments

pull/39/head
Nikolai Frolov (Akvelon INC) 3 years ago
parent b5a05e45d5
commit fa49641719

@ -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)

Loading…
Cancel
Save