Skip to content

Commit

Permalink
Merge pull request #5608 from ykuijs/Dev
Browse files Browse the repository at this point in the history
Add check to New-M365DSCReportFromConfiguration to test for WinRm enablement
  • Loading branch information
ykuijs authored Jan 8, 2025
2 parents e951219 + 6d9f775 commit 480b056
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 12 additions & 5 deletions Modules/Microsoft365DSC/Modules/M365DSCReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 480b056

Please sign in to comment.