Member-only story
How to improve Powershell Code Quality
Writing code is similar to normal writing, it is important that others can read and understand your code, considering that maintaining and changing others code consumes normaly 70 to 80% the time of Developers and QA Engineers.
As Azure DevOps and windows servers continue to be used in very conservative enterprises, the need for powershell scripting increases, because it allows you to write more fine tuned pipelines for building and releasing code.
With both considerations taken into account it becomes important to have tools that helps you write better code, one of this tools is PSScripterAnalyzer : a powershell module available at well known PSGallery.
PSScriptAnalyzer allows to analyze your powershell code to get recomendations and best practices.
Install PSScriptAnalyzer
# run as administrator
Install-Module -Name PSScriptAnalyzeror if you do not have admin privileges
Install-Module -Name PSScriptAnalyzer -Scope CurrentUserUse PSScriptAnalyzer
You can review what commands does the module provides
Get-Command -Module PSScriptAnalyzer







