Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deldersveld/d6c434e4a6fdc3adabdd7df8d1e44d4f to your computer and use it in GitHub Desktop.
Save deldersveld/d6c434e4a6fdc3adabdd7df8d1e44d4f to your computer and use it in GitHub Desktop.
Login-AzureRmAccount
$containerName = <<string containing container name>>
$storageContext = New-AzureStorageContext -ConnectionString <<connection string to storage account>>
$localDestinationPath = <<string containing file system path.>>
$blobPrefix = <<string containing prefix to search. wildcard character not needed after prefix.>>
#List
#Get-AzureStorageBlob -Context $storageContext -Container $containerName -Prefix $blobPrefix
#List and Download
Get-AzureStorageBlob -Context $storageContext -Container $containerName -Prefix $blobPrefix | ForEach-Object {Get-AzureStorageBlobContent -context $storageContext -Container $containerName -Blob $_.Name -Destination $localDestinationPath -Force}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment