diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a4fdcc01a..5a74890159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log for Microsoft365DSC +# UNRELEASED + +* M365DSCDRGUTIL + * Fix an issue where temporary parameters were not renamed during recursive call causing a Model Validation error during creation or update of a Graph resource + Fixes [#3582](https://github.com/microsoft/Microsoft365DSC/issues/3582) + # 1.23.1108.1 * AADExternalIdentityPolicy diff --git a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 index 318f1becae..90f4d660e6 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 @@ -63,7 +63,7 @@ function Rename-M365DSCCimInstanceParameter $values = @() foreach ($item in $Properties) { - $values += Rename-M365DSCCimInstanceParameter $item + $values += Rename-M365DSCCimInstanceParameter $item -KeyMapping $KeyMapping } $result = $values @@ -76,6 +76,7 @@ function Rename-M365DSCCimInstanceParameter { $result = ([Hashtable]$Properties).clone() } + if ($type -like '*CimInstance*' -or $type -like '*Hashtable*' -or $type -like '*Object*') { $hashProperties = Get-M365DSCDRGComplexTypeToHashtable -ComplexObject $result @@ -92,7 +93,7 @@ function Rename-M365DSCCimInstanceParameter if ($null -ne $property) { $hashProperties.Remove($key) - $hashProperties.add($keyName, (Rename-M365DSCCimInstanceParameter $property)) + $hashProperties.add($keyName, (Rename-M365DSCCimInstanceParameter $property -KeyMapping $KeyMapping)) } } $result = $hashProperties