Skip to content

Instantly share code, notes, and snippets.

@bcnzer
Created August 31, 2018 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bcnzer/bf35b88380f8b7ba17930b954cefa7ba to your computer and use it in GitHub Desktop.
Save bcnzer/bf35b88380f8b7ba17930b954cefa7ba to your computer and use it in GitHub Desktop.
Script to delete all the content in a blob storage container
$Context = New-AzureStorageContext -StorageAccountName $(BlobServiceName) -StorageAccountKey $(WolfTrackerBlobKey)
$blobs = Get-AzureStorageBlob -Context $Context -Container $(WolfTrackerBlobContainer)
foreach ($blob in $blobs)
{
Write-Host ("Removing Blob: {0}" -f $blob.Name)
Remove-AzureStorageBlob -ICloudBlob $blob.ICloudBlob -Context $Context
}
Write-Host "DONE - deleted all the files in the container $ContainerName"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment