Skip to content

Commit 2f19fe5

Browse files
minor prerelease change
1 parent c9d2940 commit 2f19fe5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-RemoveStandardTemplate.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ function Invoke-RemoveStandardTemplate {
1818
$Table = Get-CippTable -tablename 'templates'
1919
$Filter = "PartitionKey eq 'StandardsTemplateV2' and GUID eq '$ID'"
2020
$ClearRow = Get-CIPPAzDataTableEntity @Table -Filter $Filter -Property PartitionKey, RowKey, JSON
21-
$TemplateName = (ConvertFrom-Json -InputObject $ClearRow.JSON -ErrorAction SilentlyContinue).templateName
21+
if ($ClearRow.JSON) {
22+
$TemplateName = (ConvertFrom-Json -InputObject $ClearRow.JSON -ErrorAction SilentlyContinue).templateName
23+
} else {
24+
$TemplateName = ''
25+
}
2226
Remove-AzDataTableEntity -Force @Table -Entity $ClearRow
2327
$Result = "Removed Standards Template named: '$($TemplateName)' with id: $($ID)"
2428
Write-LogMessage -Headers $Headers -API $APIName -message $Result -Sev Info

0 commit comments

Comments
 (0)