Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M365DSCDRGUtil: Write properties properly indented and in new line in blueprints #3705

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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