diff --git a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 index fe17e784d8..8ecd72fd98 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 @@ -2435,16 +2435,30 @@ function Export-IntuneSettingCatalogPolicySettings '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance' { $values = @() - $childValues = if ($IsRoot) { $SettingInstance.AdditionalProperties.simpleSettingCollectionValue.value } else { $SettingInstance.simpleSettingCollectionValue.value } + $childValues = if ($IsRoot) { $SettingInstance.AdditionalProperties.simpleSettingCollectionValue } else { $SettingInstance.simpleSettingCollectionValue } foreach ($value in $childValues) { - $values += $value + if ($value.'@odata.type' -eq '#microsoft.graph.deviceManagementConfigurationIntegerSettingValue') + { + $values += [int]$value.value + } + else + { + $values += $value + } } $settingValue = $values } Default { - $settingValue = $SettingInstance.value + if ($SettingInstance.'@odata.type' -eq '#microsoft.graph.deviceManagementConfigurationIntegerSettingValue') + { + $settingValue += [int]$SettingInstance.value + } + else + { + $settingValue = $SettingInstance.value + } } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOPropertyBag.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOPropertyBag.Tests.ps1 index 1144c7cd33..c55b88bdd8 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOPropertyBag.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOPropertyBag.Tests.ps1 @@ -85,12 +85,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-PnPPropertyBag -MockWith { - return @( - @{ - Key = 'MyKey' - Value = 'MyValue' - } - ) + 'MyValue' } }