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

Test-Json doesn't recognize JSON arrays or primitives #11384

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Steps to reproduce

'42' | Test-Json | Should -BeTrue
'[ 1, 2 ]' | Test-Json | Should -BeTrue

Expected behavior

The tests should succeed, given that these are valid JSON strings and that piping them to ConvertFrom-Json works just fine:

# These tests pass.
'42' | ConvertFrom-Json | Should -Be 42
'[ 1, 2 ]' | ConvertFrom-Json | Should -Be 1, 2

Actual behavior

Both tests fail.

Environment data

PowerShell Core 7.0.0-rc.1
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type
    No fields configured for issues without a 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.