Created
March 12, 2019 15:56
-
-
Save z2z/0266f9fb1a7cf1ac9fd911c3e2104428 to your computer and use it in GitHub Desktop.
Download containers from Azure storage account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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