[Herramientas]: PowerShell Script Analyzer!

En esta ocasión, y gracias a este post de Tahir Naveed, os comparto una utilidad pensada para asegurar la calidad de nuestros scripts PowerShell: El PowerShell Script Analyzer. Se trata de una herramienta creada por el equipo de PowerShell de Microsoft y de la comunidad que tenéis disponible en el siguiente enlace: https://github.com/PowerShell/PSScriptAnalyzer

image

El detalle del PowerShell Script Analyzer lo podéis encontrar en la página del proyecto en GitHub:

PSScriptAnalyzer is a static code checker for Windows PowerShell modules and scripts. PSScriptAnalyzer checks the quality of Windows PowerShell code by running a set of rules. The rules are based on PowerShell best practices identified by PowerShell Team and the community. It generates DiagnosticResults (errors and warnings) to inform users about potential code defects and suggests possible solutions for improvements.

PSScriptAnalyzer is shipped with a collection of built-in rules that checks various aspects of PowerShell code such as presence of uninitialized variables, usage of PSCredential Type, usage of Invoke-Expression etc. Additional functionalities such as exclude/include specific rules are also supported.