Skip to content

Instantly share code, notes, and snippets.

@z2z
Created March 12, 2019 15:56
Show Gist options
  • Save z2z/0266f9fb1a7cf1ac9fd911c3e2104428 to your computer and use it in GitHub Desktop.
Save z2z/0266f9fb1a7cf1ac9fd911c3e2104428 to your computer and use it in GitHub Desktop.
Download containers from Azure storage account
$StorageContext = New-AzureStorageContext -StorageAccountName "xxx" -StorageAccountKey "yyy"
$containers = Get-AzureStorageContainer -Context $StorageContext
foreach ($c in $containers) {
"Transfer container " + $c.Name
$cmd = "AzCopy /Source:" + $c.CloudBlobContainer.Uri.AbsoluteUri + " /Dest:C:\myblob\" + $c.Name + " /SourceKey:yyy /S"
Write-Output $cmd
Invoke-Expression $cmd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment