Skip to content

Commit

Permalink
Merge pull request #3873 from William-Francillette/fix3582
Browse files Browse the repository at this point in the history
PR: M365DSCDRGUTIL - Fix3582
  • Loading branch information
NikCharlebois authored Nov 9, 2023
2 parents 33236cd + cac00cd commit 5ab5d6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Rename-M365DSCCimInstanceParameter
$values = @()
foreach ($item in $Properties)
{
$values += Rename-M365DSCCimInstanceParameter $item
$values += Rename-M365DSCCimInstanceParameter $item -KeyMapping $KeyMapping
}
$result = $values

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5ab5d6f

Please sign in to comment.