From acee04fdc1790ae01a98774b2a5bc29234f91b5d Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 7 Feb 2024 13:04:34 -0500 Subject: [PATCH] SCDLPCOmplianceRule Fancy Quotes Handling --- CHANGELOG.md | 2 ++ .../MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e5bdb9bc..86234791ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # UNRELEASED +* SCDLPComplianceRule + * Properly escapes fancy quotes in the Get method. * TeamsMeetingPolicy * Ignore the AllowUserToJoinExternalMeeting parameterfor drift evaluation since it doesn't do anything based on official documentation. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 index 981dd8ac89..452eeb1575 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 @@ -246,6 +246,7 @@ function Get-TargetResource $ExceptIfContentExtensionMatchesWords = $PolicyRule.ExceptIfContentExtensionMatchesWords.Replace(' ', '').Split(',') } + $fancyDoubleQuotes = "[\u201C\u201D]" $result = @{ Ensure = 'Present' Name = $PolicyRule.Name @@ -262,8 +263,8 @@ function Get-TargetResource GenerateIncidentReport = $PolicyRule.GenerateIncidentReport IncidentReportContent = $ArrayIncidentReportContent NotifyAllowOverride = $NotifyAllowOverrideValue - NotifyEmailCustomText = $PolicyRule.NotifyEmailCustomText - NotifyPolicyTipCustomText = $PolicyRule.NotifyPolicyTipCustomText + NotifyEmailCustomText = [regex]::Replace($PolicyRule.NotifyEmailCustomText, $fancyDoubleQuotes, '"') + NotifyPolicyTipCustomText = [regex]::Replace($PolicyRule.NotifyPolicyTipCustomText, $fancyDoubleQuotes, '"') NotifyUser = $PolicyRule.NotifyUser ReportSeverityLevel = $PolicyRule.ReportSeverityLevel RuleErrorAction = $PolicyRule.RuleErrorAction