1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 09:42:07 +02:00
tldr/pages/windows/test-json.md
4G3NT 87ec0727fc
pages*: add backticks to every io stream (#10442)
* pages*: add backticks to every io stream
2023-07-02 18:42:01 +05:30

17 lines
509 B
Markdown

# Test-Json
> Tests whether a string is a valid JSON document.
> This command can only be used through PowerShell.
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/test-json>.
- Test if a string from `stdin` is in JSON format:
`'{{string}}' | Test-Json`
- Test if a string JSON format:
`Test-Json -Json '{{json_to_test}}'`
- Test if a string from `stdin` matches a specific schema file:
`'{{string}}' | Test-Json -SchemaFile {{path\to\schema_file.json}}`