Skip to content

Commit f5e78da

Browse files
committed
Update Clear-CippDurables.ps1
1 parent 65d7c1f commit f5e78da

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Modules/CIPPCore/Public/Clear-CippDurables.ps1

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ function Clear-CippDurables {
1919
}
2020
}
2121

22+
Remove-AzDataTable @InstancesTable
23+
Remove-AzDataTable @HistoryTable
24+
$BlobContainer = '{0}-largemessages' -f $FunctionName
25+
if (Get-AzStorageContainer -Name $BlobContainer -Context $StorageContext -ErrorAction SilentlyContinue) {
26+
Write-Information "- Removing blob container: $BlobContainer"
27+
if ($PSCmdlet.ShouldProcess($BlobContainer, 'Remove Blob Container')) {
28+
Remove-AzStorageContainer -Name $BlobContainer -Context $StorageContext -Confirm:$false -Force
29+
}
30+
}
31+
2232
$QueueTable = Get-CippTable -TableName 'CippQueue'
2333
$CippQueue = Invoke-ListCippQueue
2434
$QueueEntities = foreach ($Queue in $CippQueue) {
@@ -45,15 +55,7 @@ function Clear-CippDurables {
4555
}
4656
}
4757

48-
Remove-AzDataTable @InstancesTable
49-
Remove-AzDataTable @HistoryTable
50-
$BlobContainer = '{0}-largemessages' -f $FunctionName
51-
if (Get-AzStorageContainer -Name $BlobContainer -Context $StorageContext -ErrorAction SilentlyContinue) {
52-
Write-Information "- Removing blob container: $BlobContainer"
53-
if ($PSCmdlet.ShouldProcess($BlobContainer, 'Remove Blob Container')) {
54-
Remove-AzStorageContainer -Name $BlobContainer -Context $StorageContext -Confirm:$false -Force
55-
}
56-
}
5758
$null = Get-CippTable -TableName ('{0}History' -f $FunctionName)
5859
Write-Information 'Durable Orchestrators and Queues have been cleared'
60+
return $true
5961
}

0 commit comments

Comments
 (0)