Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:14
What would you like to do?
Microsoft Azure: Find out storage accounts that are good to be deleted -
# Ref:
Get-AzureStorageAccount -WarningAction SilentlyContinue | ForEach-Object {
$storageAccountName = $_.StorageAccountName
$storageAccountKey = (Get-AzureSTorageKey $storageAccountName).Primary
$storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
Write-Host ""
Write-Host "Storage Account : " $storageAccountName
Get-AzureStorageContainer -Context $storageContext | ForEach-Object {
$containerName = $_.Name;
Get-AzureStorageBlob -Container $containerName -Context $storageContext | ForEach-Object {
Write-Host $containerName "`t" $_.BlobType "`t" $_.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment