Skip to content

Commit

Permalink
Migrate Intune ASR Policies to new settings catalog cmdlets and add n…
Browse files Browse the repository at this point in the history
…ew parameters
  • Loading branch information
Fabien Tschanz authored and FabienTschanz committed Jun 26, 2024
1 parent cc054aa commit 3ff43b7
Show file tree
Hide file tree
Showing 9 changed files with 769 additions and 1,073 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

* IntuneExploitProtectionPolicyWindows10SettingCatalog
* Migrate to new settings catalog cmdlets.
* IntuneSettingCatalogASRRulesPolicyWindows10
* Migrate to new settings catalog cmdlets.
* M365DSCDRGUtil
* Force array as parameter in `Compare-M365DSCIntunePolicyAssignment`.
* Fixes issues with values of type `groupSettingCollection` and `choiceSetting`
when creating the settings catalog policy settings body.

# 1.24.626.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,20 +562,9 @@ function Test-TargetResource
$target = $CurrentValues.$key
if ($null -ne $source -and $source.GetType().Name -like '*CimInstance*')
{
$source = Get-M365DSCDRGComplexTypeToHashtable -ComplexObject $source

if ($key -eq "Assignments")
{
$testResult = Compare-M365DSCIntunePolicyAssignment `
-Source $source `
-Target $target
}
else
{
$testResult = Compare-M365DSCComplexObject `
-Source ($source) `
-Target ($target)
}
$testResult = Compare-M365DSCComplexObject `
-Source ($source) `
-Target ($target)

if (-not $testResult)
{
Expand Down Expand Up @@ -668,7 +657,7 @@ function Export-TargetResource
[array]$policies = Get-MgBetaDeviceManagementConfigurationPolicy `
-All:$true `
-Filter $Filter `
-ErrorAction Stop | Where-Object -FilterScript { $_.TemplateReference.TemplateId -eq $policyTemplateID } `
-ErrorAction Stop | Where-Object -FilterScript { $_.TemplateReference.TemplateId -eq $policyTemplateID }

if ($policies.Length -eq 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,20 +415,9 @@ function Test-TargetResource
$target = $CurrentValues.$key
if ($null -ne $source -and $source.GetType().Name -like '*CimInstance*')
{
$source = Get-M365DSCDRGComplexTypeToHashtable -ComplexObject $source

if ($key -eq "Assignments")
{
$testResult = Compare-M365DSCIntunePolicyAssignment `
-Source $source `
-Target $target
}
else
{
$testResult = Compare-M365DSCComplexObject `
-Source ($source) `
-Target ($target)
}
$testResult = Compare-M365DSCComplexObject `
-Source ($source) `
-Target ($target)

if (-not $testResult)
{
Expand Down
Loading

0 comments on commit 3ff43b7

Please sign in to comment.