Skip to content
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

Open
mlhickey opened this issue Jan 13, 2025 · 0 comments

Comments

@mlhickey
Copy link
Contributor

mlhickey commented Jan 13, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant