|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
param (
|
|
|
|
|
[Parameter(Mandatory)][string] $ManifestUrl,
|
|
|
|
|
[Parameter(Mandatory)][string] $ManifestPath,
|
|
|
|
|
[string] $AccessToken
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -38,19 +38,16 @@ function Test-DownloadUrl {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Host "Downloading manifest json from '$ManifestUrl'..."
|
|
|
|
|
try {
|
|
|
|
|
$manifestResponse = Invoke-WebRequest -Method Get -Uri $ManifestUrl -Headers $webRequestHeaders -MaximumRetryCount 5 -RetryIntervalSec 10
|
|
|
|
|
} catch {
|
|
|
|
|
Publish-Error "Unable to download manifest json from '$ManifestUrl'" $_
|
|
|
|
|
if (-not (Test-Path $ManifestPath)) {
|
|
|
|
|
Publish-Error "Unable to find manifest json file at '$ManifestPath'"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Host "Parsing manifest json content from '$ManifestUrl'..."
|
|
|
|
|
Write-Host "Parsing manifest json content from '$ManifestPath'..."
|
|
|
|
|
try {
|
|
|
|
|
$manifestJson = $manifestResponse.Content | ConvertFrom-Json
|
|
|
|
|
$manifestJson = $( Get-Content $ManifestPath ) | ConvertFrom-Json
|
|
|
|
|
} catch {
|
|
|
|
|
Publish-Error "Unable to parse manifest json content '$ManifestUrl'" $_
|
|
|
|
|
Publish-Error "Unable to parse manifest json content '$ManifestPath'" $_
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|