A static code analyzer for PowerShell that checks scripts and modules against best practice rules.
PSScriptAnalyzer is a static code analyzer for PowerShell that checks scripts and modules against a set of best practice rules. It identifies potential code defects, such as uninitialized variables or unsafe cmdlet usage, and provides diagnostic feedback to help developers write more reliable and maintainable PowerShell code.
PowerShell developers, script authors, and module maintainers who want to enforce coding standards and improve code quality in their projects.
Developers choose PSScriptAnalyzer because it is the official static analysis tool for PowerShell, backed by the PowerShell Team, and it provides a comprehensive, extensible rule set based on community best practices.
Download ScriptAnalyzer from PowerShellGallery
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes built-in rules for common issues like uninitialized variables and avoiding Invoke-Expression, based on PowerShell Team and community best practices, providing thorough code quality checks.
Supports creating and integrating user-defined rules, allowing teams to enforce project-specific standards and adapt the analyzer to unique needs.
Developed and maintained by the PowerShell Team, ensuring alignment with core PowerShell updates and reliability for enterprise use.
Generates detailed errors and warnings with improvement suggestions, helping developers quickly understand and fix code defects.
User documentation is split between the GitHub repo and learn.microsoft.com, which can lead to confusion, outdated info, and a steeper learning curve for new users.
Building from source requires multiple dependencies like .NET 8.0 SDK and specific tools (e.g., Visual Studio), making it less accessible for casual contributors or quick setups.
Only performs static checks, so it cannot catch runtime errors, logic bugs, or environment-specific issues, necessitating additional testing tools.