PSScriptAnalyzer is a static code analyzer for PowerShell modules and scripts that checks code quality against a set of built-in rules based on PowerShell best practices.
The tool addresses the need to identify potential defects and quality issues in PowerShell code before execution. It operates by running a collection of rules that examine various aspects of code, including the presence of uninitialized variables, use of PSCredential types, use of Invoke-Expression, and many other patterns. When issues are found, PSScriptAnalyzer generates diagnostic results in the form of errors and warnings, along with suggested improvements to help developers fix problems.
PSScriptAnalyzer is suitable for any developer or team writing PowerShell modules or scripts who wants to enforce code quality standards and catch common mistakes early. The tool ships with built-in rules covering security concerns, best practices, and code quality patterns identified by the PowerShell Team and community. It integrates with the PowerShell Gallery for easy installation and can be incorporated into development workflows and CI/CD pipelines.
The project maintains active engagement with the community through a documented code of conduct and security policy. Development activity shows responsiveness to contributions, with the team having reorganized documentation to separate user-facing content from code-focused documentation, indicating ongoing maintenance and evolution of the project structure. The project accepts contributions and maintains a presence on the PowerShell Gallery as the primary distribution channel.