Report formats

PSRafScan report formats
FormatUse
PlainTextA readable summary with findings, issue text, and recommended changes.
JsonStructured output for automation, storage, or another approved tool.

Finding fields

Parser and rule findings use one normalized model.

  • Source, RuleName, and Variant
  • Severity and Category
  • Line, Column, and Text
  • Issue, Fix, and RawMessage

Severity and FailOn

Severity belongs to the finding. FailOn controls the process result and does not remove lower-severity findings from the report.

Threshold behavior
FailOnRule result
AnyInformation, Warning, or Error can return 1.
WarningWarning or Error can return 1.
ErrorOnly Error can return 1.
NoneRule findings do not return 1; syntax errors still return 2.

Process results

PSRafScan process results
CodeStatusMeaning
0PassNo finding met the threshold after parsing succeeded.
1FailAt least one rule finding met the threshold.
2ParseErrorThe 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."
    }
  ]
}