Skip to content

Instantly share code, notes, and snippets.

@aessing
Last active January 30, 2024 12:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save aessing/236ef7bba66d724c6de4992ac77b7b60 to your computer and use it in GitHub Desktop.
Save aessing/236ef7bba66d724c6de4992ac77b7b60 to your computer and use it in GitHub Desktop.
Install AzCopy on Windows (PowerShell)
# =============================================================================
# Install AzCopy on Windows (PowerShell)
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
# https://github.com/Azure/azure-storage-azcopy
# -----------------------------------------------------------------------------
# Developer.......: Andre Essing (https://www.andre-essing.de/)
# (https://github.com/aessing)
# (https://twitter.com/aessing)
# (https://www.linkedin.com/in/aessing/)
# -----------------------------------------------------------------------------
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
# =============================================================================
# Download and extract
Invoke-WebRequest -Uri "https://aka.ms/downloadazcopy-v10-windows" -OutFile AzCopy.zip -UseBasicParsing
Expand-Archive ./AzCopy.zip ./AzCopy -Force
# Move AzCopy
mkdir ~\AppData\Local\Programs\AZCopy
Get-ChildItem ./AzCopy/*/azcopy.exe | Move-Item -Destination ~\AppData\Local\Programs\AZCopy\
# Add AzCopy to PATH
$userenv = (Get-ItemProperty -Path 'HKCU:\Environment' -Name Path).path
$newPath = "$userenv;%USERPROFILE%\AppData\Local\Programs\AZCopy;"
New-ItemProperty -Path 'HKCU:\Environment' -Name Path -Value $newPath -Force
# Clean the kitchen
del -Force AzCopy.zip
del -Force -Recurse .\AzCopy\
@Simon-Syd
Copy link

many thanks !

@marceloaraujor
Copy link

Tks!

@mistyn8
Copy link

mistyn8 commented Jan 30, 2024

Great.. hopefully improved slightly here https://gist.github.com/mistyn8/a53828bdc6da9299836cfd4073d61d8e using %AppDataLocal% and to check we don't keep appending the env var with every run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment