Report formats

PSRafScan report formats
FormatUse
PlainTextHuman-readable summary, findings, issue text, fix text, and recommendations.
JsonStructured report for automation, archival, or carefully redacted tool handoff.

Normalized finding fields

Each normalized parser or custom-rule finding can include the following fields. A per-finding File field is not part of the reviewed normalized model.

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

Severity and FailOn

Severity belongs to the finding. FailOn belongs to the scan decision. FailOn does not remove findings below the selected threshold from the JSON report.

Severity threshold behavior
FailOnCustom-rule result
AnyInformation, Warning, or Error can return 1.
WarningWarning or Error can return 1.
ErrorOnly Error can return 1.
NoneCustom-rule findings do not return 1; parser errors still return 2.

Implemented process results

PSRafScan process result codes
CodeStatusMeaning
0PassNo finding met the selected threshold after successful parsing.
1FailAt least one custom-rule finding met the threshold.
2ParseErrorOne or more native parser errors were reported.

Valid JSON shape

{
  "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 },
  "FailureReason": "A finding met the selected Warning threshold.",
  "Recommendation": { "Lines": ["Review and fix the warning finding before running the script."] },
  "Findings": [
    {
      "Source": "CustomRule",
      "RuleName": "SilentErrorAction",
      "Variant": "",
      "Severity": "Warning",
      "Category": "ErrorHandling",
      "Line": 8,
      "Column": 1,
      "Text": "Get-Item -LiteralPath $Path -ErrorAction SilentlyContinue",
      "Issue": "The script uses -ErrorAction SilentlyContinue, which can hide failures that should be handled.",
      "Fix": "Prefer -ErrorAction Stop with meaningful handling.",
      "RawMessage": ""
    }
  ]
}