PSRAFSCAN DOCUMENTATION
Choose Ps1File or TerminalPaste
Choose the exact PSRafScan intended-use mode for a saved PowerShell script or live terminal paste and understand the six paste-only checks.
Direct answer
Compare the contexts
| Question | Ps1File | TerminalPaste |
|---|---|---|
| Source unit | One saved script file | Input assembled and submitted by a terminal host or line editor |
| Top-level param() | Binds values during script invocation | A bare paste has no script filename invocation |
| #Requires | Declares script prerequisites | Replace with deliberate runtime checks or keep the code as a script |
| Script-path variables | $PSScriptRoot and $PSCommandPath describe the executing file | No executing .ps1 path exists for a direct paste |
| Multiline input | Parser sees the complete file | A host can accept a complete block before a later continuation arrives |
The six TerminalPaste-only rules
At PSRafScan 0.2.0-alpha1, 52 active rules apply to both modes and these six apply only to TerminalPaste:
FunctionInsidePasteWrapperPasteSensitiveContinuationBlockPasteSensitiveDoWhileRequiresInTerminalPasteScriptFileVariableInTerminalPasteTopLevelParamInTerminalPaste
Use two questions
- Will this exact text be saved and invoked as a .ps1 file? Choose Ps1File.
- Will this exact text be entered directly into a live terminal? Choose TerminalPaste.
- Is the delivery method still undecided? Decide it before scanning because the contexts are not interchangeable.
Account for the host
PowerShell, PSReadLine, the terminal host, and the paste mechanism can change interactive behavior. TerminalPaste flags source patterns that need a context decision; it does not emulate every host or prove how a later paste will behave.
RSX -Path ./saved-script.ps1 -IntendedUse Ps1File -FailOn Warning
RSX -Path ./paste-candidate.ps1 -IntendedUse TerminalPaste -FailOn Warning