Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Dec 9, 2022
1 parent a2068be commit 3227016
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
* DEPENDENCIES
* Updated MSCloudLoginAssistant to version 1.0.100;
FIXES [#2484](https://github.com/microsoft/Microsoft365DSC/issues/2484)
* MISC
* Added support for the ExcludedProperties parameter in the New-M365DSCDeltaReport function.
FIXES [#2444](https://github.com/microsoft/Microsoft365DSC/issues/2444)

# 1.22.1207.1

Expand Down
32 changes: 27 additions & 5 deletions Modules/Microsoft365DSC/Modules/M365DSCReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,10 @@ Local path of the destination configuraton.
Array that contains the list of configuration components for the source.
.Parameter DestinationObject
Array that contains the list of configuration components for the destination. |
Array that contains the list of configuration components for the destination.
.Parameter ExcludedProperties
Array that contains the list of configuration components for the destination.
.Example
Compare-M365DSCConfigurations -Source 'C:\DSC\source.ps1' -Destination 'C:\DSC\destination.ps1'
Expand Down Expand Up @@ -459,7 +462,11 @@ function Compare-M365DSCConfigurations

[Parameter()]
[Array]
$DestinationObject
$DestinationObject,

[Parameter()]
[Array]
$ExcludedProperties
)

if ($CaptureTelemetry)
Expand Down Expand Up @@ -533,6 +540,8 @@ function Compare-M365DSCConfigurations
'ManagedIdentity'
)

$filteredProperties = ($filteredProperties + $ExcludedProperties) | Select-Object -Unique

[System.Collections.Hashtable]$destinationResource = $destinationResource[0]
# The resource instance exists in both the source and the destination. Compare each property;
foreach ($propertyName in $sourceResource.Keys)
Expand Down Expand Up @@ -806,6 +815,9 @@ Specifies that file that contains a custom header for the report.
.Parameter Delta
An array with difference, already compiled from another source.
.Parameter ExcludedProperties
Array that contains the list of configuration components for the destination.
.Example
New-M365DSCDeltaReport -Source 'C:\DSC\Source.ps1' -Destination 'C:\DSC\Destination.ps1' -OutputPath 'C:\Dsc\DeltaReport.html'
Expand Down Expand Up @@ -851,7 +863,11 @@ function New-M365DSCDeltaReport
[Parameter()]
[System.String]
[ValidateSet('HTML', 'JSON')]
$Type = 'HTML'
$Type = 'HTML',

[Parameter()]
[Array]
$ExcludedProperties
)

# Validate that the latest version of the module is installed.
Expand Down Expand Up @@ -898,11 +914,17 @@ function New-M365DSCDeltaReport
{
# Parse the blueprint file, pass to Compare-M365DSCConfigurations as object (including comments aka metadata)
[Array] $ParsedBlueprintWithMetadata = Initialize-M365DSCReporting -ConfigurationPath $Destination -IncludeComments:$true
$Delta = Compare-M365DSCConfigurations -Source $Source -DestinationObject $ParsedBlueprintWithMetadata -CaptureTelemetry $false
$Delta = Compare-M365DSCConfigurations -Source $Source `
-DestinationObject $ParsedBlueprintWithMetadata `
-CaptureTelemetry $false `
-ExcludedProperties $ExcludedProperties
}
Else
{
$Delta = Compare-M365DSCConfigurations -Source $Source -Destination $Destination -CaptureTelemetry $false
$Delta = Compare-M365DSCConfigurations `-Source $Source `
-Destination $Destination `
-CaptureTelemetry $false `
-ExcludedProperties $ExcludedProperties
}
}

Expand Down

0 comments on commit 3227016

Please sign in to comment.