Skip to content

Commit

Permalink
Merge pull request #3705 from ricmestre/Dev
Browse files Browse the repository at this point in the history
M365DSCDRGUtil: Write properties properly indented and in new line in blueprints
  • Loading branch information
NikCharlebois authored Sep 20, 2023
2 parents f7b4abb + 6d43a44 commit 0c43bb3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 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

* MISC
* M365DSCDRGUtil: Write properties properly indented and in new line
FIXES [#3634](https://github.com/microsoft/Microsoft365DSC/issues/3634)

# 1.23.920.1

* O365OrgSettings
Expand Down
16 changes: 8 additions & 8 deletions Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function Get-M365DSCDRGComplexTypeToString
$currentValue = $ComplexObject[$key]
if ($currentValue.GetType().Name -eq 'String')
{
$currentValue = $ComplexObject[$key].Replace("'", "''").Replace("’", "''")
$currentValue = $ComplexObject[$key].Replace("'", "''").Replace("", "''")
}
$currentProperty += Get-M365DSCDRGSimpleObjectTypeToString -Key $key -Value $currentValue -Space ($indent)
}
Expand Down Expand Up @@ -430,17 +430,17 @@ function Get-M365DSCDRGComplexTypeToString
}

$currentProperty += "$indent}"
#if ($isArray -or $IndentLevel -gt 4)
#{
#$currentProperty += "`r`n"
#}
if ($isArray -or $IndentLevel -gt 4)
{
$currentProperty += "`r`n"
}

#Indenting last parenthese when the cim instance is an array
<#if ($IndentLevel -eq 5)
#Indenting last parenthesis when the cim instance is an array
if ($IndentLevel -eq 5)
{
$indent = ' ' * ($IndentLevel -2)
$currentProperty += $indent
}#>
}

$emptyCIM = $currentProperty.replace(' ', '').replace("`r`n", '')
if ($emptyCIM -eq "MSFT_$CIMInstanceName{}")
Expand Down

0 comments on commit 0c43bb3

Please sign in to comment.