@nash Red Thank you for your query!!!
I did some research and found below script.Can you check the below script and let me know if it worked for you or not:
## Iterate through each blob
foreach($blob_iterator in $blob_list){
$blob_date = [datetime]$blob_iterator.LastModified.UtcDateTime
# Check if the blob's last modified date is less than the threshold date for deletion
if($blob_date -le $date_before_blobs_to_be_deleted) {
Write-Output "-----------------------------------" | Out-File $local_log_file_path -Append
write-output "Purging blob from Storage: " $blob_iterator.name | Out-File $local_log_file_path -Append
write-output " " | Out-File $local_log_file_path -Append
write-output "Last Modified Date of the Blob: " $blob_date | Out-File $local_log_file_path -Append
Write-Output "-----------------------------------" | Out-File $local_log_file_path -Append
# Cmdle to delete the blob
#Remove-AzureStorageBlob -Container $container -Blob $blob_iterator.Name -Context $context
$blob_count_deleted += 1
}
}
You can refer to this for more info.
Another thread which might be helpful to your use case.
Hope it helps!!!
Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.