Powershell 7 TEST-JSON

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

{
    "name": "json-server",
    "version": "0.16.1",
    "description": "Get a full fake REST API with zero coding in less than 30 seconds",
    "main": "./lib/server/index.js",
    "bin": "./lib/cli/bin.js",
    "scripts": {
        "test": "npm run build && cross-env NODE_ENV=test jest && npm run lint",
        "start": "babel-node -- src/cli/bin db.json -r routes.json",
        "lint": "eslint . --ignore-path .gitignore",
        "fix": "npm run lint -- --fix",
        "build": "babel src -d lib",
        "toc": "markdown-toc -i README.md",
        "postversion": "git push && git push --tags",
        "prepublishOnly": "npm test && npm run build && pkg-ok"
    },
    "dependencies": {
        "body-parser": "^1.19.0",
        "chalk": "^3.0.0",
        "compression": "^1.7.4",
        "connect-pause": "^0.1.1",
        "cors": "^2.8.5",
        "errorhandler": "^1.5.1",
        "express": "^4.17.1",
        "express-urlrewrite": "^1.2.0",
        "json-parse-helpfulerror": "^1.0.3",
        "lodash": "^4.17.15",
        "lodash-id": "^0.14.0",
        "lowdb": "^1.0.0",
        "method-override": "^3.0.0",
        "morgan": "^1.9.1",
        "nanoid": "^2.1.11",
        "please-upgrade-node": "^3.2.0",
        "pluralize": "^8.0.0",
        "request": "^2.88.2",
        "server-destroy": "^1.0.1",
        "update-notifier": "^4.0.0",
        "yargs": "^15.1.0"
    },
    "devDependencies": {
        "@babel/cli": "^7.8.4",
        "@babel/core": "^7.8.4",
        "@babel/node": "^7.8.4",
        "@babel/preset-env": "^7.8.4",
        "cross-env": "^7.0.0",
        "eslint": "^6.8.0",
        "eslint-config-prettier": "^6.10.0",
        "eslint-config-standard": "^14.1.0",
        "eslint-plugin-import": "^2.20.1",
        "eslint-plugin-node": "^11.0.0",
        "eslint-plugin-prettier": "^3.1.2",
        "eslint-plugin-promise": "^4.2.1",
        "eslint-plugin-standard": "^4.0.1",
        "husky": "^4.2.1",
        "jest": "^25.1.0",
        "markdown-toc": "^1.2.0",
        "mkdirp": "^1.0.3",
        "npm-run-all": "^4.1.5",
        "os-tmpdir": "^2.0.0",
        "pkg-ok": "^2.3.1",
        "prettier": "^1.19.1",
        "rimraf": "^3.0.2",
        "server-ready": "^0.3.1",
        "supertest": "^4.0.2",
        "temp-write": "^4.0.0"
    },
    "repository": {
        "type": "git",
        "url": "git://github.com/typicode/json-server.git"
    },
    "keywords": [
        "JSON",
        "server",
        "fake",
        "REST",
        "API",
        "prototyping",
        "mock",
        "mocking",
        "test",
        "testing",
        "rest",
        "data",
        "dummy",
        "sandbox"
    ],
    "author": "Typicode <typicode@gmail.com>",
    "license": "MIT",
    "bugs": {
        "url": "https://github.com/typicode/json-server/issues"
    },
    "homepage": "https://github.com/typicode/json-server",
    "engines": {
        "node": ">=10"
    },
    "husky": {
        "hooks": {
            "pre-commit": "npm test"
        }
    },
    "jest": {
        "testURL": "http://localhost/"
    }
}

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

$json = @"
{
    "name": "json-server",
    "version": "0.16.1",
    "description": "Get a full fake REST API with zero coding in less than 30 seconds",
    "main": "./lib/server/index.js",
    "bin": "./lib/cli/bin.js",
    "scripts": {
        "test": "npm run build && cross-env NODE_ENV=test jest && npm run lint",
        "start": "babel-node -- src/cli/bin db.json -r routes.json",
        "lint": "eslint . --ignore-path .gitignore",
        "fix": "npm run lint -- --fix",
        "build": "babel src -d lib",
        "toc": "markdown-toc -i README.md",
        "postversion": "git push && git push --tags",
        "prepublishOnly": "npm test && npm run build && pkg-ok"
    },
    "dependencies": {
        "body-parser": "^1.19.0",
        "chalk": "^3.0.0",
        "compression": "^1.7.4",
        "connect-pause": "^0.1.1",
        "cors": "^2.8.5",
        "errorhandler": "^1.5.1",
        "express": "^4.17.1",
        "express-urlrewrite": "^1.2.0",
        "json-parse-helpfulerror": "^1.0.3",
        "lodash": "^4.17.15",
        "lodash-id": "^0.14.0",
        "lowdb": "^1.0.0",
        "method-override": "^3.0.0",
        "morgan": "^1.9.1",
        "nanoid": "^2.1.11",
        "please-upgrade-node": "^3.2.0",
        "pluralize": "^8.0.0",
        "request": "^2.88.2",
        "server-destroy": "^1.0.1",
        "update-notifier": "^4.0.0",
        "yargs": "^15.1.0"
    },
    "devDependencies": {
        "@babel/cli": "^7.8.4",
        "@babel/core": "^7.8.4",
        "@babel/node": "^7.8.4",
        "@babel/preset-env": "^7.8.4",
        "cross-env": "^7.0.0",
        "eslint": "^6.8.0",
        "eslint-config-prettier": "^6.10.0",
        "eslint-config-standard": "^14.1.0",
        "eslint-plugin-import": "^2.20.1",
        "eslint-plugin-node": "^11.0.0",
        "eslint-plugin-prettier": "^3.1.2",
        "eslint-plugin-promise": "^4.2.1",
        "eslint-plugin-standard": "^4.0.1",
        "husky": "^4.2.1",
        "jest": "^25.1.0",
        "markdown-toc": "^1.2.0",
        "mkdirp": "^1.0.3",
        "npm-run-all": "^4.1.5",
        "os-tmpdir": "^2.0.0",
        "pkg-ok": "^2.3.1",
        "prettier": "^1.19.1",
        "rimraf": "^3.0.2",
        "server-ready": "^0.3.1",
        "supertest": "^4.0.2",
        "temp-write": "^4.0.0"
    },
    "repository": {
        "type": "git",
        "url": "git://github.com/typicode/json-server.git"
    },
    "keywords": [
        "JSON",
        "server",
        "fake",
        "REST",
        "API",
        "prototyping",
        "mock",
        "mocking",
        "test",
        "testing",
        "rest",
        "data",
        "dummy",
        "sandbox"
    ],
    "author": "Typicode <typicode@gmail.com>",
    "license": "MIT",
    "bugs": {
        "url": "https://github.com/typicode/json-server/issues"
    },
    "homepage": "https://github.com/typicode/json-server",
    "engines": {
        "node": ">=10"
    },
    "husky": {
        "hooks": {
            "pre-commit": "npm test"
        }
    },
    "jest": {
        "testURL": "http://localhost/"
    }
}
"@ 


try {
 $parsedJson = $json | ConvertFrom-Json -ErrorAction Stop
}
catch {
    'Invalid JSON'
}

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.