dsccommunity / xDSCResourceDesigner

MIT License
24 stars 19 forks source link

String literals are not escaped properly in output MOF. #13

Open rhencke opened 9 years ago

rhencke commented 9 years ago

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.

adamrushuk commented 6 years ago

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