Script Analysis and Quick Fix

Last updated last month

PSScript Analyzer Integration

PowerShell Tools for Visual studio supports PSScriptAnalyzer integration. If you have PSScriptAnalyzer installed in your $PSModulePath, PoshTools will automatically call Invoke-ScriptAnalyzer on your script and show the results as tagged regions within your code.

Script Analyzer Alias Warning

Quick Fix

PoshTools supports quick fix actions provided by PSScriptAnalyzer. If the suggestion has a Suggested Correction, PoshTools will provide a Quick Action light bulb next to the line that needs to be addressed.

Executing quick fix actions

Configuration

If you don't want PoshTools to use PSScriptAnalyzer, you can disable the analysis via the PoshTools options. Open the options menu by clicking Tools->Options and selecting PowerShell Tools. You can set Script Analyzer to false to prevent PoshTools from running PSScriptAnalyzer on your scripts.

You can also customize the Script Analyzer Setting. This can be either a built in setting or a PSSA setting file. ‚Äč

Setting in the options menu