Skip to content

Instantly share code, notes, and snippets.

@deldersveld
Created January 3, 2018 17:03
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/5a97c797bd499b3516045928b0a53402 to your computer and use it in GitHub Desktop.
Save deldersveld/5a97c797bd499b3516045928b0a53402 to your computer and use it in GitHub Desktop.
Remove all blob containers and child blobs based on the specified container name prefix
Login-AzureRmAccount
$containerPrefix = <<string containing prefix to search. wildcard character not needed after prefix.>>
$storageContext = New-AzureStorageContext -ConnectionString <<connection string to storage account>>
Get-AzureStorageContainer -context $storageContext -prefix $containerPrefix | ForEach-Object {Remove-AzureStorageContainer -context $storageContext -Container $_.Name -Force}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment