I am writing a power shell script to download files from a azure blob storage container.The files are inside a folder in the container. The blob container structure looks like A>B>C.csv(Where A is my container). I want to download only C.csv to my local folder. I wrote script as below.
$AccountName = "X"
$ContainerName = "A"
$Key="dcg"
$Context= New-AzureStorageContext -StorageAccountName $AccountName -StorageAccountKey $Key
$Files=Get-AzureStorageBlob -Container $ContainerName -Context $Context -prefix "A/B"|
Where-Object {($_.ContentType -eq "application/octet-stream")}
$DestinationPath = "D:\localfolder"
$files |Get-AzureStorageBlobContent -Destination $DestinationPath -Context $Context
But this script copy entire folder structure to my local folder. So my local folder contains LocalFolder>A>B>C.csv, but I need only C.csv to be downloaded(LocalFolder>C.csv). Can anyone please help me to resolve this issue?