diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEOPProtectionPolicyRule/MSFT_EXOEOPProtectionPolicyRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEOPProtectionPolicyRule/MSFT_EXOEOPProtectionPolicyRule.psm1 index f5852c72a4..2ae3854191 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEOPProtectionPolicyRule/MSFT_EXOEOPProtectionPolicyRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEOPProtectionPolicyRule/MSFT_EXOEOPProtectionPolicyRule.psm1 @@ -262,7 +262,7 @@ function Set-TargetResource } } - Set-EOPProtectionPolicyRule @UpdateParameters | Out-Null + Set-EOPProtectionPolicyRule @UpdateParameters } elseif ($Ensure -eq 'Absent' -and $currentInstance.Ensure -eq 'Present') { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOEOPProtectionPolicyRule.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOEOPProtectionPolicyRule.Tests.ps1 index 0c2b3e53a5..f21e9a56ab 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOEOPProtectionPolicyRule.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOEOPProtectionPolicyRule.Tests.ps1 @@ -52,7 +52,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "The EXOEOPProtectionPolicyRule exists but it SHOULD NOT" -Fixture { BeforeAll { $testParams = @{ - Ensure = 'Absent' + Ensure = 'Present' Credential = $Credential; ExceptIfRecipientDomainIs = @("contoso.onmicrosoft.com"); Identity = "Strict Preset Security Policy"; @@ -68,6 +68,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { ExceptIfRecipientDomainIs = @("contoso.onmicrosoft.com") Comments = "FakeStringValue" Priority = 0 + State = "Enabled"; } } diff --git a/Tests/Unit/Stubs/Generic.psm1 b/Tests/Unit/Stubs/Generic.psm1 index 1a5a7ead8c..a18029efcf 100644 --- a/Tests/Unit/Stubs/Generic.psm1 +++ b/Tests/Unit/Stubs/Generic.psm1 @@ -1241,20 +1241,6 @@ function Get-EOPProtectionPolicyRule ) } -function Set-EOPProtectionPolicyRule -{ - [CmdletBinding()] - Param( - [Parameter()] - [System.String] - $Identity, - - [Parameter()] - [System.String] - $State - ) -} - function Enable-EOPProtectionPolicyRule { [CmdletBinding()]