PSRAFSCAN DOCUMENTATION
Reports, Findings, and Exit Codes
Understand PlainText and JSON reports, finding fields, severities, FailOn thresholds, sensitive output, and process results 0, 1, and 2.
Report formats
| Format | Use |
|---|---|
PlainText | A readable summary with findings, issue text, and recommended changes. |
Json | Structured output for automation, storage, or another approved tool. |
Finding fields
Parser and rule findings use one normalized model.
Source,RuleName, andVariantSeverityandCategoryLine,Column, andTextIssue,Fix, andRawMessage
Severity and FailOn
Severity belongs to the finding. FailOn controls the process result and does not remove lower-severity findings from the report.
| FailOn | Rule result |
|---|---|
Any | Information, Warning, or Error can return 1. |
Warning | Warning or Error can return 1. |
Error | Only Error can return 1. |
None | Rule findings do not return 1; syntax errors still return 2. |
Process results
| Code | Status | Meaning |
|---|---|---|
0 | Pass | No finding met the threshold after parsing succeeded. |
1 | Fail | At least one rule finding met the threshold. |
2 | ParseError | The native parser reported a syntax error. |
JSON example
{
"SchemaVersion": "1.0",
"Tool": "PSRafScan",
"ScriptPath": "/work/candidate.ps1",
"IntendedUse": "Ps1File",
"FailOn": "Warning",
"ExitCode": 1,
"Status": "Fail",
"Summary": { "Total": 1, "Error": 0, "Warning": 1, "Information": 0 },
"Findings": [
{
"Source": "CustomRule",
"RuleName": "SilentErrorAction",
"Severity": "Warning",
"Category": "ErrorHandling",
"Line": 8,
"Column": 1,
"Issue": "The script uses -ErrorAction SilentlyContinue, which can hide failures.",
"Fix": "Prefer -ErrorAction Stop with meaningful handling."
}
]
}