Select the first of the download locations

This commit is contained in:
Aditya Patwardhan
2022-11-08 15:46:45 -08:00
parent 5e078cd9e2
commit 09fa48c7e3
+1 -1
View File
@@ -3365,7 +3365,7 @@ function Install-AzCopy {
}
$destination = "$env:TEMP\azcopy10.zip"
$downloadLocation = (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue -SkipHttpErrorCheck).headers.location
$downloadLocation = (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue -SkipHttpErrorCheck).headers.location | Select-Object -First 1
Invoke-WebRequest -Uri $downloadLocation -OutFile $destination -Verbose
Expand-archive -Path $destination -Destinationpath '$(Agent.ToolsDirectory)\azcopy10'