Opinionated PSScriptAnalyzer custom rules
Install from the PowerShell Gallery
import-module -name ScriptAnalyzerRulesLWA
Run the rules against your code
Invoke-ScriptAnalyzer -CustomRulePath (Get-Module -name ScriptAnalyzerRulesLWA).path -Path ./MyScript.ps1 -verbose
See Contributing file.