Created
August 31, 2018 08:31
-
-
Save bcnzer/bf35b88380f8b7ba17930b954cefa7ba to your computer and use it in GitHub Desktop.
Script to delete all the content in a blob storage container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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