Skip to content

Commit

Permalink
Merge pull request #3584 from coolriku/Dev
Browse files Browse the repository at this point in the history
MSFT_EXOSafeAttachmentPolicy: Deprecated ActionOnError Parameter
  • Loading branch information
NikCharlebois authored Aug 23, 2023
2 parents 9e0a987 + dbf7bbe commit 57cd261
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change log for Microsoft365DSC
* EXOSafeAttachmentPolicy
* Deprecated ActionOnError Parameter
FIXES [#3579](https://github.com/microsoft/Microsoft365DSC/issues/3579)

* AADGroupsSettings
* Add support for enabling sensitivity labels in M365-groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,27 +254,23 @@ function Set-TargetResource
$StopProcessingPolicy = $false
if ($Redirect -eq $true)
{
if ($ActionOnError -eq $true){
Write-Verbose -Message "The ActionOnError parameter is deprecated"
$SafeAttachmentPolicyParams.Remove('ActionOnError') | Out-Null
}
$Message = 'Cannot proceed with processing of SafeAttachmentPolicy because Redirect is set to true '
if ($ActionOnError -eq $false)
if ([String]::IsNullOrEmpty($RedirectAddress))
{
$Message += 'and ActionOnError is false'
$Message += 'and RedirectAddress is null'
$StopProcessingPolicy = $true
}
else
{
if ([String]::IsNullOrEmpty($RedirectAddress))
{
$Message += 'and RedirectAddress is null'
$StopProcessingPolicy = $true
}
}
if ($StopProcessingPolicy -eq $true)
{
Write-Verbose -Message $Message
try
{
$Message = 'Please ensure that if Redirect is set to true then ' + `
'ActionOnError is also set to true and RedirectAddress is not null'
$Message = 'Please ensure that if Redirect is set to true ' + `
'and RedirectAddress is not null'
New-M365DSCLogEntry -Message $Message `
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
Expand Down

0 comments on commit 57cd261

Please sign in to comment.