File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ function Set-CIPPStandardsCompareField {
66 )
77 $Table = Get-CippTable - tablename ' CippStandardsReports'
88 $TenantName = Get-Tenants | Where-Object - Property defaultDomainName -EQ $Tenant
9- # if the fieldname does not contain standards. prepend it.
10- $FieldName = $FieldName -replace ' \.' , ' _'
9+
10+ # Sanitize invalid c#/xml characters for Azure Tables
11+ $FieldName = $FieldName.replace (' standards.' , ' standards_' )
12+ $FieldName = $FieldName.replace (' IntuneTemplate.' , ' IntuneTemplate_' )
13+ $FieldName = $FieldName -replace ' -' , ' __'
14+
1115 if ($FieldValue -is [System.Boolean ]) {
1216 $fieldValue = [bool ]$FieldValue
1317 } elseif ($FieldValue -is [string ]) {
@@ -40,6 +44,6 @@ function Set-CIPPStandardsCompareField {
4044 }
4145 Write-Information " Adding $FieldName to StandardCompare for $Tenant . content is $FieldValue "
4246 } catch {
43- Write-Warning " Failed to add $FieldName to StandardCompare for $Tenant . content is $FieldValue . The error was: $ ( $_.Exception.Message ) "
47+ Write-Warning " Failed to add $FieldName to StandardCompare for $Tenant . content is $FieldValue - $ ( $_.Exception.Message ) "
4448 }
4549}
You can’t perform that action at this time.
0 commit comments