You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the suggestion @jessehouwing this would make a good custom rule, or this seems like the kind of thing that could be good for a feedback provider. Typically we don't add things into script analyzer that are code optimizers or work arounds. I will mark this as up for grabs if you want to try opening a PR for it.
Summary of the new feature
When you call
get-content file.json | convertfrom-json
, funny things happen whenfile.json
contains a comment at the top of the file.Multiple places suggest that it's better to use
get-content -raw
for performance and predictability.See:
Proposed technical implementation details (optional)
When
get-content
is piped toconvertfrom-*
, PSScriptAnalyzer should suggest adding-raw
toget-content
.The same could apply to
[xml] get-content file.xml
.What is the latest version of PSScriptAnalyzer at the point of writing
1.21
The text was updated successfully, but these errors were encountered: