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

DRG - generates schema where parameter Description-content can contain quotes #2819

Closed
salbeck-sit opened this issue Jan 20, 2023 · 3 comments · Fixed by #2823 or #2851
Closed

DRG - generates schema where parameter Description-content can contain quotes #2819

salbeck-sit opened this issue Jan 20, 2023 · 3 comments · Fixed by #2823 or #2851

Comments

@salbeck-sit
Copy link
Contributor

Details of the scenario you tried and the problem that is occurring

When I build a resource using DRG and the description for a parameter contains quotes, these are not replaced or edited meaning that the resulting mof-file is unreadable to DSC.

Verbose logs showing the problem

Suggested solution to the issue

Location in the DRG-module where comments are added to the mof-definition: Lines 721 and 726, $mofSchemaContent.Appendline(... $property.Description)....). Code should be added to ensure the description is edited so quotes are replaced by apostrophes or something similar.
I don't have available time to do a PR myself but thought I'd bring it up.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here
New-M365DSCResource....

#### The operating system the target node is running

#### Version of the DSC module that was used ('dev' if using current dev branch)
dev
@William-Francillette
Copy link
Contributor

Could you share the cmdlet noun used to generate the resource please - I'll have a look

@William-Francillette
Copy link
Contributor

William-Francillette commented Jan 22, 2023

I have updated PR #2823 to force replacing double quote in description by single quote in the XML Parser (function Get-TypeProperties)

@salbeck-sit
Copy link
Contributor Author

Sounds right. I came across it when testing another resource and got an error from DSC complaining about an unrelated resource-schema that turned out to have a field that contained double quotes as part of the description

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