-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-M365DSCDRGComplexTypeToString: Special characters not handled correctly for Convert-DSCStringParamToVariable #5623
Comments
@mlhickey Do you have a sample configuration that we can use to check and fix it? Or quickly explain the steps to reproduce? We're currently working on an updated way to handle the exports, so it would be great if we can consider this issue in there too. |
WÓJCIK - VENTILATION S.A.
Cheers,
Mike Hickey
"Dream as if you'll live forever, live as if you'll die tomorrow"
…________________________________
From: Fabien Tschanz ***@***.***>
Sent: Wednesday, January 15, 2025 1:38 PM
To: microsoft/Microsoft365DSC ***@***.***>
Cc: mlhickey ***@***.***>; Mention ***@***.***>
Subject: Re: [microsoft/Microsoft365DSC] Get-M365DSCDRGComplexTypeToString: Special characters not handled correctly for Convert-DSCStringParamToVariable (Issue #5623)
@mlhickey<https://github.com/mlhickey> Do you have a sample configuration that we can use to check and fix it? Or quickly explain the steps to reproduce? We're currently working on an updated way to handle the exports, so it would be great if we can consider this issue in there too.
—
Reply to this email directly, view it on GitHub<#5623 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE2HKHALTM2BOVAAXBSZV4T2K3ILTAVCNFSM6AAAAABVDBCDGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJTHE4TAMBYGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@FabienTschanz Exporting this morning using 1.25.219.2
|
@martincaddick What's the resource you're exporting? And how should it look like to be correct? |
Description of the issue
When Get-M365DSCDRGComplexTypeToString resolves fancyDoubleQuotes at 480:
if ($null -ne $currentProperty) { $fancySingleQuotes = "[\u2019\u2018]" $fancyDoubleQuotes = "[\u201C\u201D]" $currentProperty = [regex]::Replace($currentProperty, $fancySingleQuotes, "''") $currentProperty = [regex]::Replace($currentProperty, $fancyDoubleQuotes, '"') }
it results in broken strings when the fancyDoubleQuotes are located inside the string. Example string:
'
WÓJCIK - VENTILATION S.A.
'
where the double-quote is a UTF8 double-quote. This causes Convert-DSCStringParamToVariable to terminate the string early :
Convert-DSCStringParamToVariable: Exception calling "IndexOf" with "2" argument(s): "Index was out of range. Must be non-negative and less than or equal to the size of the collection. (Parameter 'startIndex')"
Microsoft 365 DSC Version
DEV/1.25.108.1
Which workloads are affected
other
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: