Skip to content

Commit

Permalink
Merge pull request #5659 from FabienTschanz/feat/report-config-valida…
Browse files Browse the repository at this point in the history
…tion

Add empty or invalid configuration message
  • Loading branch information
NikCharlebois authored Jan 22, 2025
2 parents fdfb259 + e1f2343 commit 9280452
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
* M365DSCReport
* Fix missing delimiter when called without the parameter.
FIXES [#5634](https://github.com/microsoft/Microsoft365DSC/issues/5634)
* Add configuration validation to inform about comparisons against empty or invalid configurations.
FIXES [#5658](https://github.com/microsoft/Microsoft365DSC/issues/5658)
* M365DSCTelemetryEngine
* Report LCM details only if running as administrator.
* M365DSCUtil
Expand Down
6 changes: 5 additions & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2073,8 +2073,12 @@ function Initialize-M365DSCReporting
$parsedContent = ConvertTo-DSCObject -Content $fileContent
}

return $parsedContent
if ($null -eq $parsedContent)
{
Write-Warning -Message "No configuration found in $ConfigurationPath. Either the configuration was empty or the file was not a valid DSC configuration."
}

return $parsedContent
}

Export-ModuleMember -Function @(
Expand Down

0 comments on commit 9280452

Please sign in to comment.