Commands

PSRafScan commands
CommandPurpose
Invoke-PSRafScanRun a guided scan, direct scan, catalog listing, or self-test.
RSXAlias for Invoke-PSRafScan.
Get-PSRafScanRuleList and filter rule metadata.
Get-PSRafScanSelfTestList and filter self-test metadata.
Invoke-PSRafScanSelfTestRun the self-test suite and format the result.

Direct scan parameters

Direct scan parameters
ParameterAccepted value or behaviorDefault
PathExisting file path; cannot be combined with ClipboardNone
ClipboardUse current clipboard text; cannot be combined with PathOff
IntendedUsePs1File or TerminalPastePs1File
FailOnAny, Warning, Error, or NoneWarning
OutputFormatPlainText or JsonPlainText
OutputPathWrite the report to this pathReturn the report
HideInformationDetailReduce Information detail in PlainTextOff
NoColorDisable terminal colorOff
NonInteractivePrevent the guided flowOff

Catalog and self-test options

Use -SelfTest, -ListRules, -ListSelfTests, or -Help to select a non-scan operation. Catalog commands support filters for rule name, category, type, severity, intended use, tags, aliases, text, and lifecycle state.

RSX -ListRules -Tag git
Get-PSRafScanRule -Category CredentialSafety -Severity Warning
Get-PSRafScanSelfTest -RuleName UnapprovedVerb -TestKind Negative
RSX -SelfTest
RSX -Help

Examples

RSX -Path ./script.ps1 -IntendedUse Ps1File -FailOn Warning
RSX -Clipboard -IntendedUse TerminalPaste -FailOn Warning
RSX -Path ./script.ps1 -IntendedUse Ps1File -FailOn Error -OutputFormat Json -OutputPath ./result.json

Exit codes

Exit codes are 0 for pass, 1 when findings meet the selected threshold, and 2 for syntax errors.