From 4113d882c98a337bdfe1ba852ae32ba59dbd2fa3 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 17 Oct 2023 11:44:30 -0400 Subject: [PATCH] Fixes Fancy Quotes in Complex Objects During Export. --- CHANGELOG.md | 2 ++ Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353384db3f..cd9b13bb0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ * TeamsUserPolicyAssignment * Initial release. FIXES [#3777](https://github.com/microsoft/Microsoft365DSC/issues/3777) +* MISC + * Fixes fancy quotes in complex objects for extraction. # 1.23.1011.1 diff --git a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 index 30f7fc9122..53c6531a34 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 @@ -447,6 +447,14 @@ function Get-M365DSCDRGComplexTypeToString { $currentProperty = $null } + + if ($null -ne $currentProperty) + { + $fancySingleQuotes = "[\u2019\u2018]" + $fancyDoubleQuotes = "[\u201C\u201D]" + $currentProperty = [regex]::Replace($currentProperty, $fancySingleQuotes, "''") + $currentProperty = [regex]::Replace($currentProperty, $fancyDoubleQuotes, '"') + } return $currentProperty }