AzCopy Updater Tool

Quick script to update AzCopy to the latest version.

This sample will download the latest version of AzCopy and place it in the C:\Azcopy folder. If you need to go back to a specific version, the previous versions will also be archived.

$root = "C:\azcopy"
$path = "$root\temp"
If(!(test-path -PathType container $path))
{
      New-Item -ItemType Directory -Path $path
}
$getfilename = (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue -UseBasicParsing).headers.location
$outputFile = Split-Path $getfilename -leaf
(Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -OutFile "$($path)\$($outputFile)" -ErrorAction SilentlyContinue)
Expand-archive -Path "$($path)\$($outputFile)" -DestinationPath "$($root)" -Force
$outputdir = [io.path]::GetFileNameWithoutExtension("$($path)\$($outputFile)")
Copy-Item "$($root)\$($outputdir)\azcopy.exe" -destination "c:\azcopy\"

About the author

Jeff Pigott is a Senior Cloud Solution Architect at Microsoft, with expertise in Azure technologies such as Arc, DevOps, security, storage, and more. He has over 29 years of experience in IT, development, and DevOps, working with various platforms, tools, and languages. He is passionate about learning the newest Microsoft technologies and services, and holds several Azure certifications.