diff --git a/CHANGELOG.md b/CHANGELOG.md index 347bee63d0..5404b8bd42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,12 @@ * DefenderDeviceAuthenticatedScanDefinition * Fixed the Data Type export. * MISC - * DEFENDER - * Added support for the UseBasicParsing paramter for REST calls. + * Added check to `New-M365DSCReportFromConfiguration` to make sure Windows + Remoting is enabled, which is required to convert the DSC config. + * Defender + * Added support for the UseBasicParsing parameter for REST calls. + +# 1.24.1218.1 * AADApplication * Added support for Oauth2PermissionScopes. diff --git a/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 index 1ecbbefb85..50d924d40c 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 @@ -722,22 +722,29 @@ function New-M365DSCReportFromConfiguration } process # required with DynamicParam { - + # Test if Windows Remoting is enabled, which is needed to run this function. + $result = Test-WSMan -ErrorAction SilentlyContinue + if ($null -eq $result) + { + Write-Error -Message 'Windows Remoting is NOT configured yet. Please configure Windows Remoting (by running `Enable-PSRemoting -SkipNetworkProfileCheck`) before running this function.' + return + } + # Validate that the latest version of the module is installed. Test-M365DSCModuleValidity - + #Ensure the proper dependencies are installed in the current environment. Confirm-M365DSCDependencies - + #region Telemetry $data = [System.Collections.Generic.Dictionary[[String], [String]]]::new() $data.Add('Event', 'Report') $data.Add('Type', $Type) Add-M365DSCTelemetryEvent -Data $data -Type 'NewReport' #endregion - + [Array] $parsedContent = Initialize-M365DSCReporting -ConfigurationPath $ConfigurationPath - + if ($null -ne $parsedContent) { switch ($Type)