Skip to content

Commit 37ef372

Browse files
committed
Cast TemplateId to string in standards compare field
Ensures TemplateId is explicitly cast to string when adding or updating entities in Set-CIPPStandardsCompareField, improving type consistency for Azure Table storage operations.
1 parent bd6a102 commit 37ef372

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/Set-CIPPStandardsCompareField.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ function Set-CIPPStandardsCompareField {
2323
try {
2424
if ($Existing) {
2525
$Existing.Value = $FieldValue
26-
$Existing | Add-Member -NotePropertyName TemplateId -NotePropertyValue $script:CippStandardInfoStorage.Value.StandardTemplateId -Force
26+
$Existing | Add-Member -NotePropertyName TemplateId -NotePropertyValue ([string]$script:CippStandardInfoStorage.Value.StandardTemplateId) -Force
2727
Add-CIPPAzDataTableEntity @Table -Entity $Existing -Force
2828
} else {
2929
$Result = [PSCustomObject]@{
3030
PartitionKey = [string]$TenantName.defaultDomainName
3131
RowKey = [string]$FieldName
3232
Value = $FieldValue
33-
TemplateId = $script:CippStandardInfoStorage.Value.StandardTemplateId
33+
TemplateId = [string]$script:CippStandardInfoStorage.Value.StandardTemplateId
3434
}
3535
Add-CIPPAzDataTableEntity @Table -Entity $Result -Force
3636
}

0 commit comments

Comments
 (0)