Skip to content

Document -Path and -LiteralPath parameter in Test-Json Utility Cmdlet #9814

@ArmaanMcleod

Description

@ArmaanMcleod

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

Add -Path and -LiteralPath parameter to Test-Json cmdlet. This allows the user to validate JSON from file paths, instead of just a JSON string.

Details

The new parameter sets for this cmdlet is:

Test-Json [-Json] <string> [<CommonParameters>]

Test-Json [-Json] <string> [-Schema] <string> [<CommonParameters>]

Test-Json [-Json] <string> [-SchemaFile] <string> [<CommonParameters>]

Test-Json [-Path] <string> [<CommonParameters>]

Test-Json [-Path] <string> [-Schema] <string> [<CommonParameters>]

Test-Json [-Path] <string> [-SchemaFile] <string> [<CommonParameters>]

Test-Json [-LiteralPath] <string> [<CommonParameters>]

Test-Json [-LiteralPath] <string> [-Schema] <string> [<CommonParameters>]

Test-Json [-LiteralPath] <string> [-SchemaFile] <string> [<CommonParameters>]

Examples:

With -Path:

PS C:\> Test-Json -Path data.json

With -LiteralPath:

PS C:\> Test-Json -LiteralPath '[data].json'

Articles

  • reference/7.3/Microsoft.PowerShell.Utility/Test-Json.md

Related Source Pull Requests

Related Source Issues

Metadata

Metadata

Assignees

Labels

area-utilityArea - Microsoft.PowerShell.Utility moduleissue-doc-ideaIssue - request for new content

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions