Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Jul 22, 2022
1 parent 147cf9d commit 1104a2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* MISC
* Added support for filtering resources instances at extraction time.
FIXES [#1691](https://github.com/microsoft/Microsoft365DSC/issues/1691)
* REPORT: Fixed an issue where if the ModuleVersion was not specified, that the file would fail to properly get parsed.
FIXES [#1970](https://github.com/microsoft/Microsoft365DSC/issues/1970)

# 1.22.720.1

Expand Down
20 changes: 16 additions & 4 deletions Modules/Microsoft365DSC/Modules/M365DSCReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,28 @@ function Compare-M365DSCConfigurations
{
$fileContent = Get-Content $Source -Raw
$startPosition = $fileContent.IndexOf(" -ModuleVersion")
$endPosition = $fileContent.IndexOf("`r", $startPosition)
$fileContent = $fileContent.Remove($startPosition, $endPosition - $startPosition)
if ($startPosition -ge 0)
{
$endPosition = $fileContent.IndexOf("`r", $startPosition)
if ($endPosition -gt $startPosition)
{
$fileContent = $fileContent.Remove($startPosition, $endPosition - $startPosition)
}
}
[Array] $SourceObject = ConvertTo-DSCObject -Content $fileContent
}
if (-not $DestinationObject)
{
$fileContent = Get-Content $Destination -Raw
$startPosition = $fileContent.IndexOf(" -ModuleVersion")
$endPosition = $fileContent.IndexOf("`r", $startPosition)
$fileContent = $fileContent.Remove($startPosition, $endPosition - $startPosition)
if ($startPosition -ge 0)
{
$endPosition = $fileContent.IndexOf("`r", $startPosition)
if ($endPosition -gt $startPosition)
{
$fileContent = $fileContent.Remove($startPosition, $endPosition - $startPosition)
}
}
[Array] $DestinationObject = ConvertTo-DSCObject -Content $FileContent
}

Expand Down

0 comments on commit 1104a2a

Please sign in to comment.