diff --git a/automatic/azcopy10/update.ps1 b/automatic/azcopy10/update.ps1 index 61efacfa8b5..03af12ac2d2 100644 --- a/automatic/azcopy10/update.ps1 +++ b/automatic/azcopy10/update.ps1 @@ -2,6 +2,18 @@ $releases = 'https://aka.ms/downloadazcopy-v10-windows' +function global:au_GetLatest { + $url64 = Get-RedirectedUrl -Url $releases + $url32 = $url64 -replace "amd64", "386" + $version = $url64 -replace ".zip", "" -split "_" | Select-Object -Last 1 + + @{ + URL32 = $url32 + URL64 = $url64 + Version = $version + } +} + function global:au_SearchReplace { @{ ".\tools\chocolateyInstall.ps1" = @{ @@ -15,18 +27,4 @@ function global:au_SearchReplace { } } -function global:au_GetLatest { - $download_page = Invoke-WebRequest -Uri $releases -MaximumRedirection 0 -ErrorAction SilentlyContinue - - $url64 = $download_page.Headers.Location - $url32 = $url64 -replace "amd64", "386" - $version = $url64 -replace ".zip", "" -split "_" | Select-Object -Last 1 - - @{ - URL32 = $url32 - URL64 = $url64 - Version = $version - } -} - update -ChecksumFor all