What is PSScriptAnalyzer used for

What is PSScriptAnalyzer used for ?

PSScriptAnalyzer is code quality scanner developed by Microsoft to scan powershell code. 

PSScriptAnalyzer can be installed using below command in Powershell ISE 

“Install-Module -Name PSScriptAnalyzer”
PSScriptAnalyzer cmndlet to unit test powershell code below:

“Invoke-ScriptAnalyzer -Path ‘path of targetted ps1 file to be scanned for code quality’