Powershell 7 TEST-JSON

Welcome Forums General PowerShell Q&A Powershell 7 TEST-JSON

Viewing 1 reply thread
  • Author
    Posts
    • #251993
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      The Test-Json module does not validate a valid Json.
      Take a look at this Json, it’s validated from jsonlint but in powershell I get Cannot parse the JSON

      • This topic was modified 1 month ago by kvprasoon. Reason: Code formatting and moving to proper forum
    • #252146
      Participant
      Topics: 15
      Replies: 1775
      Points: 3,214
      Helping Hand
      Rank: Community Hero

      Not familiar with Test-Json, but an option would be to just attempt a parse like this:

      This uses the built-in JSON parser to attempt to create a valid object in Powershell. If you want to use Test-Json, you’ll have to reach out to the module creator and work with them on any bug.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.