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 787b74b commit 512d626
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* PlannerBucket & PlannerPlan
* Changed invalid permissions in the setting.json files.
FIXES [#2629](https://github.com/microsoft/Microsoft365DSC/issues/2629)
* SCRetentionComplianceRule
* Fixed an Issue where properties weren't properly set at creation, causing drifts to be detected.
FIXES [#2471](https://github.com/microsoft/Microsoft365DSC/issues/2471)
* SPOUserProfileProperty
* Removed multi-threading to align with other resources.
* Fixed an issue where we were contacting Microsoft Graph to retrieve users without authenticating to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ function Set-TargetResource
Write-Verbose -Message 'Checking to see if the policy is a Teams based one.'
$RuleObject = Get-RetentionComplianceRule -Identity $Name `
-ErrorAction SilentlyContinue
$AssociatedPolicy = Get-RetentionCompliancePolicy $RuleObject.Policy
$AssociatedPolicy = Get-RetentionCompliancePolicy $Policy

if ($AssociatedPolicy.TeamsPolicy)
{
Write-Verbose -Message 'The current policy is a Teams based one, removing invalid parameters.'
Write-Verbose -Message 'The current policy is a Teams based one, removing invalid parameters for Creation.'
if ($CreationParams.ContainsKey('ApplyComplianceTag'))
{
$CreationParams.Remove('ApplyComplianceTag') | Out-Null
Expand Down Expand Up @@ -251,6 +251,7 @@ function Set-TargetResource
}
}

Write-Verbose -Message "Creating new RetentionComplianceRule with values:`r`n$(Convert-M365DscHashtableToString -Hashtable $CreationParams)"
New-RetentionComplianceRule @CreationParams
}
elseif (('Present' -eq $Ensure) -and ('Present' -eq $CurrentRule.Ensure))
Expand All @@ -269,7 +270,7 @@ function Set-TargetResource

if ($AssociatedPolicy.TeamsPolicy)
{
Write-Verbose -Message 'The current policy is a Teams based one, removing invalid parameters.'
Write-Verbose -Message 'The current policy is a Teams based one, removing invalid parameters for Update.'

if ($CreationParams.ContainsKey('ApplyComplianceTag'))
{
Expand Down Expand Up @@ -301,6 +302,7 @@ function Set-TargetResource
}
}

Write-Verbose -Message "Updating RetentionComplianceRule with values:`r`n$(Convert-M365DscHashtableToString -Hashtable $CreationParams)"
Set-RetentionComplianceRule @CreationParams
}
elseif (('Absent' -eq $Ensure) -and ('Present' -eq $CurrentPolicy.Ensure))
Expand Down

0 comments on commit 512d626

Please sign in to comment.