Samples/PSScriptAnalyzer/readme.txt

PSScriptAnalyzer module
 
PSScriptAnalyzer is a static code checker for PowerShell modules and scripts; see https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/overview?view=ps-modules
 
Installing: in a PS console with admin rights, execute:
 
PS > Install-Module -Name PSScriptAnalyzer -Force
 
Command to see output of Error and Warning findings:
PS > Invoke-ScriptAnalyzer -Recurse -Path * -Settings .\PSScriptAnalyzerSettings.psd1 | Where-Object { $_.Severity -match ''Error|warning' } | Format-List > output.txt
 
Update PSScriptAnalyzerSettings.psd1 file in order to customize the rules that you want to exclude.