diff --git a/CHANGELOG.md b/CHANGELOG.md index b7aca7c948..0406bbd4a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ * IntuneDeviceConfigurationPolicyWindows10 * Fixed issue where the edgeSearchEngine value was not properly retrieved. FIXES [#1783](https://github.com/microsoft/Microsoft365DSC/issues/1783) +* SCSensitivityLabel + * Fixed an issue where '$' in the custom wordmark test would cause issue. + FIXES [#2067](https://github.com/microsoft/Microsoft365DSC/issues/2067) * TeamsUser * Fixed the extraction process and removed the multi-threading from the resource. FIXES #1883 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 index 9da92b840d..4a99df3341 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 @@ -264,6 +264,25 @@ function Get-TargetResource $EncryptionRightsDefinitionsValue = Convert-EncryptionRightDefinition -RightsDefinition $label.EncryptionRightsDefinitions } Write-Verbose "Found existing Sensitivity Label $($Name)" + + $ApplyContentMarkingFooterTextValue = $null + if ($null -ne $label.ApplyContentMarkingFooterText) + { + $ApplyContentMarkingFooterTextValue = $label.ApplyContentMarkingFooterText.Replace('$', '`$') + } + + $ApplyContentMarkingHeaderTextValue = $null + if ($null -ne $label.ApplyContentMarkingHeaderText) + { + $ApplyContentMarkingHeaderTextValue = $label.ApplyContentMarkingHeaderText.Replace('$', '`$') + } + + $ApplyWaterMarkingTextValue = $null + if ($null -ne $label.ApplyWaterMarkingText) + { + $ApplyWaterMarkingTextValue = $label.ApplyWaterMarkingText.Replace('$', '`$') + } + $result = @{ Name = $label.Name Comment = $label.Comment @@ -282,20 +301,20 @@ function Get-TargetResource ApplyContentMarkingFooterFontName = $label.ApplyContentMarkingFooterFontName ApplyContentMarkingFooterFontSize = $label.ApplyContentMarkingFooterFontSize ApplyContentMarkingFooterMargin = $label.ApplyContentMarkingFooterMargin - ApplyContentMarkingFooterText = $label.ApplyContentMarkingFooterText + ApplyContentMarkingFooterText = $ApplyContentMarkingFooterTextValue ApplyContentMarkingHeaderAlignment = $label.ApplyContentMarkingHeaderAlignment ApplyContentMarkingHeaderEnabled = $label.ApplyContentMarkingHeaderEnabled ApplyContentMarkingHeaderFontColor = $label.ApplyContentMarkingHeaderFontColor ApplyContentMarkingHeaderFontName = $label.ApplyContentMarkingHeaderFontName ApplyContentMarkingHeaderFontSize = $label.ApplyContentMarkingHeaderFontSize ApplyContentMarkingHeaderMargin = $label.ApplyContentMarkingHeaderMargin - ApplyContentMarkingHeaderText = $label.ApplyContentMarkingHeaderText + ApplyContentMarkingHeaderText = $ApplyContentMarkingHeaderTextValue ApplyWaterMarkingEnabled = $label.ApplyWaterMarkingEnabled ApplyWaterMarkingFontColor = $label.ApplyWaterMarkingFontColor ApplyWaterMarkingFontName = $label.ApplyWaterMarkingFontName ApplyWaterMarkingFontSize = $label.ApplyWaterMarkingFontSize ApplyWaterMarkingLayout = $label.ApplyWaterMarkingLayout - ApplyWaterMarkingText = $label.ApplyWaterMarkingText + ApplyWaterMarkingText = $ApplyWaterMarkingTextValue EncryptionAipTemplateScopes = $label.EncryptionAipTemplateScopes EncryptionContentExpiredOnDateInDaysOrNever = $label.EncryptionContentExpiredOnDateInDaysOrNever EncryptionDoNotForward = $label.EncryptionDoNotForward