Skip to content

Commit

Permalink
Merge pull request microsoft#3677 from NikCharlebois/Fixes-#3479
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Sep 12, 2023
2 parents 6bdbe24 + 0fcf6c9 commit 93e5346
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* MISC
* Improved error logging for methods installing or updating modules.
FIXES [#3660](https://github.com/microsoft/Microsoft365DSC/issues/3660)
* Single quotes handling in Export for complex CIMInstances
FIXES [#3479](https://github.com/microsoft/Microsoft365DSC/issues/3479)

# 1.23.906.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ function Export-TargetResource
$currentDSCBlock = $currentDSCBlock.replace( " ,`r`n" , " `r`n" )
$currentDSCBlock = $currentDSCBlock.replace( "`r`n;`r`n" , "`r`n" )
$currentDSCBlock = $currentDSCBlock.replace( "`r`n,`r`n" , "`r`n" )
$currentDSCBlock = $currentDSCBlock.Replace("} Enabled = `$","}`r`n Enabled = `$")

$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
Expand Down
7 changes: 6 additions & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,12 @@ function Get-M365DSCDRGComplexTypeToString
}
else
{
$currentProperty += Get-M365DSCDRGSimpleObjectTypeToString -Key $key -Value $ComplexObject[$key] -Space ($indent)
$currentValue = $ComplexObject[$key]
if ($currentValue.GetType().Name -eq 'String')
{
$currentValue = $ComplexObject[$key].Replace("'", "''").Replace("’", "''")
}
$currentProperty += Get-M365DSCDRGSimpleObjectTypeToString -Key $key -Value $currentValue -Space ($indent)
}
}
else
Expand Down

0 comments on commit 93e5346

Please sign in to comment.