xDSCResourceDesigner icon indicating copy to clipboard operation
xDSCResourceDesigner copied to clipboard

String literals are not escaped properly in output MOF.

Open rhencke opened this issue 10 years ago • 1 comments

MOF strings have escaping rules that are not honored by the current xDSCResourceDesigner implementation, which can cause xDSCResourceDesigner to create MOF files with syntax errors.

For example:

<snip>
New-xDscResourceProperty `
    -Name Account `
    -Description 'User name must be specified in the form of DOMAIN\USER' `
    -Type PSCredential `
    -Attribute Required
<snip>

will generate an invalid MOF string literal of:

"User name must be specified in the form of DOMAIN\USER"

The correct MOF string literal should be:

"User name must be specified in the form of DOMAIN\\USER"

See http://www.dmtf.org/sites/default/files/standards/documents/DSP0221_3.0.0.pdf, line 1089 for the full specification for MOF strings.

rhencke avatar May 19 '15 15:05 rhencke

I got burned by this bug today when using "Format: Domain\Account Name\Password" in the Description text. :(

adamrushuk avatar Jun 17 '18 19:06 adamrushuk