Skip to content

Commit

Permalink
Merge pull request microsoft#4627 from FabienTschanz/fix/onboarding-blob
Browse files Browse the repository at this point in the history
Fix policy creation when onboarding blob is specified and tenant is Defender for Endpoint enrolled
  • Loading branch information
NikCharlebois authored May 8, 2024
2 parents bb8d82b + 9323ac7 commit 398a3f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
FIXES [#4283](https://github.com/microsoft/Microsoft365DSC/issues/4283)
* IntuneDeviceConfigurationCustomPolicyWindows10
* Fixed an issue where the payload of xml files was not encoded as base64.
* IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10
* Fixed a creation and update issue when the exported policy contains a
onboarding blob and the tenant is connected to Defender for Endpoint Service.
* M365DSCUtil
* Fixed an issue where one could not pass empty arrays to the
`Compare-PSCustomObjectArrays` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ function Set-TargetResource

$CreateParameters = ([Hashtable]$BoundParameters).clone()
$CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters

if ($AdvancedThreatProtectionAutoPopulateOnboardingBlob -and `
$PSBoundParameters.AdvancedThreatProtectionAutoPopulateOnboardingBlob)
{
$CreateParameters.Remove('AdvancedThreatProtectionOnboardingBlob') | Out-Null
}

$CreateParameters.Remove('Id') | Out-Null

$keys = (([Hashtable]$CreateParameters).clone()).Keys
Expand Down Expand Up @@ -325,6 +332,12 @@ function Set-TargetResource
$UpdateParameters = ([Hashtable]$BoundParameters).clone()
$UpdateParameters = Rename-M365DSCCimInstanceParameter -Properties $UpdateParameters

if ($AdvancedThreatProtectionAutoPopulateOnboardingBlob -and `
$PSBoundParameters.AdvancedThreatProtectionAutoPopulateOnboardingBlob)
{
$UpdateParameters.Remove('AdvancedThreatProtectionOnboardingBlob') | Out-Null
}

$UpdateParameters.Remove('Id') | Out-Null

$keys = (([Hashtable]$UpdateParameters).clone()).Keys
Expand Down

0 comments on commit 398a3f8

Please sign in to comment.