Lint PowerShell With PSScriptAnalyzer
Detect risky patterns and style problems before code review.
01Command
$ Invoke-ScriptAnalyzer -Path . -Recurse02What it does
PSScriptAnalyzer applies rules for security, correctness and style, such as avoiding Invoke-Expression and using approved verbs. Running it recursively returns findings that CI can fail on, which is far more consistent than manual review and is naturally a command-line task.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- PSScriptAnalyzer overviewEvidence: Static analysis module that flags rule violations in PowerShell code.
Last verified: 2026-10-13 · Category: Developer
06Related solutions
Use Windows Package Manager to install, search, and upgrade thousands of applications from the community repository in one command.
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
Search inside text files and logs with regex, returning file, line number and match.