From 6db91aca60b111cd4f25489ae8138d9e548f57f3 Mon Sep 17 00:00:00 2001 From: William-francillette Date: Wed, 8 Nov 2023 19:59:14 +0000 Subject: [PATCH 1/2] fix Rename-M365DSCCimInstanceParameter --- Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From cac00cd5cb4992563653079a03d43fba01f7823b Mon Sep 17 00:00:00 2001 From: William-francillette Date: Wed, 8 Nov 2023 20:02:56 +0000 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) 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