Native parser
PowerShell parser findings surface syntax errors before deeper review begins.
Source: ParserPOWERSHELL 7.4+ SCRIPT REVIEW
PSRafScan reviews AI-generated and user-written PowerShell scripts for parser errors, unsafe operations, hidden failures, and terminal-paste traps.
Runs on Windows, macOS, and Linux · MIT licensed · No external module dependency
RSX -Path .\script.ps1 -IntendedUse Ps1File -FailOn WarningPowerShell Script Check Report
Scanning .\script.ps1
1 file scanned, 1 finding
-ErrorAction SilentlyContinue can hide failures that should be handled.
Prefer -ErrorAction Stop with a meaningful catch block, or record the skipped error.
ANALYSIS MODEL
PSRafScan reads the target script without intentionally executing it. The selected FailOn threshold turns review findings into a dependable pass or fail result.
PowerShell parser findings surface syntax errors before deeper review begins.
Source: ParserBuilt-in rules inspect safety, correctness, portability, credentials, Git, and paste behavior.
Source: CustomRuleEvery finding identifies the triggering text, explains the issue, and gives a direct fix.
Plain text or JSONRun PSRafScan, fix every finding at the chosen threshold, and scan again before the final script is delivered.
EXECUTION CONTEXT
PowerShell that works as a saved file can fail when pasted into a live terminal. IntendedUse lets PSRafScan apply the right checks.
For code copied directly into a live PowerShell 7 terminal. This mode catches console-sensitive patterns that may parse differently, pause unexpectedly, or rely on saved-file context.
RSX -Path .\candidate.ps1 -IntendedUse TerminalPasteFor code saved and executed as a .ps1 file. Normal script-file concepts remain available, and PSRafScan concentrates on parser, correctness, safety, and maintenance findings.
RSX -Path .\candidate.ps1 -IntendedUse Ps1FileBUILT-IN CATALOG
The current source snapshot contains 58 PSRafScan-owned rules across safety, correctness, portability, credential, output, privilege, and automation categories.
Flags fragile backtick line continuations that can break during copy and paste.
Finds git push --force operations that can overwrite remote history.
Finds OneDrive paths that can fail for another user, sandbox, or sync state.
Finds commands that may stop automation and wait for interactive input.
Calls out operations that probably require an Administrator session.
Finds raw Markdown fence lines accidentally placed in executable code.
Finds native commands whose exit status is not checked before continuing.
Finds password-like parameters modeled as plain strings.
Finds recursive forced deletes that lack a safety guard.
Flags SilentlyContinue when it can hide a failure that should be handled.
Calls out commands that commonly change system configuration.
Finds commands that are not recognized in the current PowerShell 7 environment.
Search the complete catalog by rule name, category, type, severity, tag, intended use, alias, or free text.
Get-PSRafScanRule -Search passwordUse the included templates to extend PSRafScan for your own standards, then follow the authoring guide to define metadata, expected findings, positive cases, and false-positive regression tests.
COMMAND INTERFACE
Invoke-PSRafScan is the primary command. RSX is the short alias for terminal use, automation, and acceptance loops.
Open the guided terminal workflow.
RSXReview a .ps1 file and fail on warnings or errors.
RSX -Path ".\script.ps1" -IntendedUse Ps1File -FailOn WarningApply the paste-safety checks before copying code into PS7.
RSX -Path ".\candidate.ps1" -IntendedUse TerminalPaste -FailOn WarningWrite structured output for automation and AI tools.
RSX -Path ".\script.ps1" -OutputFormat Json -OutputPath ".\result.json"Run RSX by itself for a guided path through source selection, intended use, failure threshold, report format, and export.
INSTALL PSRAFSCAN
Download the release ZIP, extract the PSRafScan module folder, and place it in a PowerShell module path. No external PowerShell module is required.
Open GitHub releases$HOME\Documents\PowerShell\Modules$HOME/.local/share/powershell/ModulesImport-Module PSRafScan
Get-Command RSX
RSX -SelfTestPROJECT DOCUMENTATION
The documentation follows the same structure as the tool: direct commands, explicit contexts, searchable metadata, and verifiable self-tests.
Use the interactive workflow, read findings, and export reports.
READ ON GITHUB ↗02Use PSRafScan from the command line and as an AI acceptance gate.
READ ON GITHUB ↗03Create your own rules and rule self-tests with the included templates.
READ ON GITHUB ↗04Review safe defaults, supported versions, and vulnerability reporting.
READ ON GITHUB ↗