From 4775de64eb752b90267114c0c1c95235820521f3 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Thu, 5 Feb 2026 16:03:08 +0000 Subject: add CLI validators in Node.js, PowerShell, and Bash Move validate.js to validators/nodejs/ and add equivalent validators for PowerShell and Bash. Each includes a README with usage instructions and requirements. --- validators/powershell/README.md | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 validators/powershell/README.md (limited to 'validators/powershell/README.md') diff --git a/validators/powershell/README.md b/validators/powershell/README.md new file mode 100644 index 0000000..822659e --- /dev/null +++ b/validators/powershell/README.md @@ -0,0 +1,46 @@ +# PowerShell Validator + +A PowerShell script for validating `.gitinfo` files. + +## Requirements + +- PowerShell 5.1+ (Windows) or PowerShell Core 7+ (cross-platform) + +## Usage + +```powershell +# Validate .gitinfo in current directory +.\Validate-GitInfo.ps1 + +# Validate a specific file +.\Validate-GitInfo.ps1 -Path "path/to/.gitinfo" +``` + +## Features + +- Parses JSONC (strips `//` and `/* */` comments) +- Validates against the gitinfo JSON Schema +- Checks types, formats (URI, email), and patterns +- Enforces `additionalProperties: false` +- Returns exit code 0 on success, 1 on failure +- Color-coded output (green for success, red for errors) + +## Example Output + +``` +✓ .gitinfo is valid +``` + +``` +Validation failed for .gitinfo: + - .root: invalid URI "not-a-url" + - root: unknown property "invalid_field" +``` + +## Notes + +On Windows, you may need to adjust the execution policy: + +```powershell +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser +``` -- cgit v1.2.3