PowerShell Code to Get the blob content to local.
Explanation of scenario below-
I have code written me on how to download the blob folder level to the local & its working. But my main focus is as below suggest me how this can be achieved. storage account has container --folder1,2etc.. folder1 inside that will have dir1, 2 etc.., now i want to get the content of the particular dir1 from folder 1 using PS.
The already working code on folder level is below for reference - guide me on the next level.
Connect-AzAccount -Subscription "XXXX"
$container_name = 'A/B/C'
$destination_path = "C:\Users\Anirudh\Documents\upload\"
$storage_account = New-AzStorageContext -StorageAccountKey "XXXXX" -StorageAccountName "XXXXX"
$blobs = Get-AzStorageBlob -Container $container_name -Context $storage_account
foreach($blob in $blobs) {
New-Item -ItemType Directory -Force -Path $destination_path
Get-AzStorageBlobContent -Container $container_name -Blob $blob.Name -Destination $destination_path -Context $storage_account
}
Thanks.