forked from seansp-zz/Framework-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean_bootdiag_containers.ps1
More file actions
26 lines (20 loc) · 1.09 KB
/
clean_bootdiag_containers.ps1
File metadata and controls
26 lines (20 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
param (
[Parameter(Mandatory=$false)] [string] $resourceGroup="smoke_bvts_resource_group",
[Parameter(Mandatory=$false)] [string] $storageAccount="smokebvt"
)
. "C:\Framework-Scripts\secrets.ps1"
Write-Host "Cleaning boot diag blobs from storage account $storageAccount, resource group $resourceGroup"
Write-Host "Importing the context...."
Import-AzureRmContext -Path 'C:\Azure\ProfileContext.ctx'
Write-Host "Selecting the Azure subscription..."
Select-AzureRmSubscription -SubscriptionId "$AZURE_SUBSCRIPTION_ID"
Set-AzureRmCurrentStorageAccount –ResourceGroupName $resourceGroup –StorageAccountName $storageAccount
$containers=get-azurestoragecontainer
foreach ($container in $containers) {
if ($container.Name -like "bootdiag*") {
Remove-AzureStorageContainer -Force -Name $container.Name
}
}
# Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroup | Remove-AzureRmNetworkInterface -ResourceGroupName $resourceGroup -force
# Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup | Remove-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup -force