Tutorial by Examples

ScriptAnalyzer ships with sets of built-in preset rules that can be used to analyze scripts. These include: PSGallery, DSC and CodeFormatting. They can be executed as follows: PowerShell Gallery rules To execute the PowerShell Gallery rules use the following command: Invoke-ScriptAnalyzer -Path /...
To run the script analyzer against a single script file execute: Invoke-ScriptAnalyzer -Path myscript.ps1 This will analyze your script against every built-in rule. If your script is sufficiently large that could result in a lot of warnings and/or errors. To run the script analyzer against a w...
To see all the built-in rules execute: Get-ScriptAnalyzerRule

Page 1 of 1