# PSScriptAnalyzer

Check PowerShell scripts and modules

Validate cmdlet usage, parameter conventions and selected reliability rules. Run the same settings against scripts and modules before publishing.

Category: Code quality
Languages: PowerShell

## Standard evidence

Rubric v1 · 3/8 verified · 5 unknown · 0 contrary · reviewed 2026-11-28

- **Definition** (unknown) — No reviewed evidence is recorded for this dimension.
- **Measurement** (verified) — Invoke-ScriptAnalyzer emits one DiagnosticRecord per rule violation; -SuppressedOnly returns a different record type. Reviewed 2026-11-28. [Source](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer)
- **Conformance** (unknown) — No reviewed evidence is recorded for this dimension.
- **CI enforcement** (verified) — The -EnableExit flag writes a process exit status derived from diagnostics, a mode Microsoft explicitly recommends for CI. Reviewed 2026-11-28. [Source](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer)
- **Getting started** (unknown) — No reviewed evidence is recorded for this dimension.
- **Real-world adoption** (verified) — CodeRabbit checks .ps1 scripts, .psm1 modules and .psd1 manifests with PSScriptAnalyzer in its review integration. Reviewed 2026-11-28. [Source](https://docs.coderabbit.ai/tools/psscriptanalyzer)
- **Agent guidance** (unknown) — No reviewed evidence is recorded for this dimension.
- **Agent portability** (unknown) — No reviewed evidence is recorded for this dimension.

## Adoption

Use PSScriptAnalyzer in this repository to meet this standard: Check PowerShell scripts and modules. Validate cmdlet usage, parameter conventions and selected reliability rules. Run the same settings against scripts and modules before publishing. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.

### Tool command

```
Invoke-ScriptAnalyzer -Path . -Recurse
```

Seikika package: no verified installation is listed.

## References

- [Tool documentation](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview)
- [Agent skill](/skills/psscriptanalyzer/SKILL.md)
