Skip to content

Commit

Permalink
Update value to be of correct type and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienTschanz committed Nov 25, 2024
1 parent a511db0 commit 4d3ca3b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
20 changes: 17 additions & 3 deletions Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
}

Mock -CommandName Get-PnPPropertyBag -MockWith {
return @(
@{
Key = 'MyKey'
Value = 'MyValue'
}
)
'MyValue'
}
}

Expand Down

0 comments on commit 4d3ca3b

Please sign in to comment.