Skip to content

Commit

Permalink
Merge pull request #4214 from ricmestre/fix4212
Browse files Browse the repository at this point in the history
TeamsComplianceRecordingPolicy: Fix condition when resource is absent
  • Loading branch information
NikCharlebois authored Jan 24, 2024
2 parents af68b51 + 7d5c971 commit 86a73d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
* TeamsAudioConferencingPolicy
* Fix condition in Test-TargetResource when resource is absent
FIXES [#4215](https://github.com/microsoft/Microsoft365DSC/issues/4215)
* TeamsComplianceRecordingPolicy
* Fix condition in Test-TargetResource when resource is absent
FIXES [#4212](https://github.com/microsoft/Microsoft365DSC/issues/4212)
* TeamsEnhancedEncryptionPolicy
* Fix condition when resource is absent
FIXES [#4221](https://github.com/microsoft/Microsoft365DSC/issues/4221)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Get-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -144,7 +144,7 @@ function Set-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -267,7 +267,7 @@ function Test-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -304,7 +304,7 @@ function Test-TargetResource
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()
$ValuesToCheck.Remove('Identity') | Out-Null

if ($CurrentValues.Ensure -eq 'Absent')
if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
Expand Down

0 comments on commit 86a73d9

Please sign in to comment.