Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rule request: Get-Content x | ConvertFrom-Json should suggest adding -raw for Get-content #1951

Copy link
Copy link
@jessehouwing

Description

@jessehouwing
Issue body actions

Summary of the new feature

When you call get-content file.json | convertfrom-json, funny things happen when file.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 to convertfrom-*, PSScriptAnalyzer should suggest adding -raw to get-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

mklement0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.