Using PS Script Analyzer
The PowerShell Script Analyzer is a PowerShell module produced by the PowerShell team that analyzes your code and provides opportunities to improve. You can download the latest version of the module from the PowerShell Gallery. Like many PowerShell modules, the script analyzer is subject to constant updating. You can always download the newest version of this module directly from GitHub.
Using the VS Code editor to develop your code, you should know that the Script Analyzer is built-in to VS Code. So as you are creating your PowerShell script, VS code highlights any errors the Script Analyzer finds. VS Code, therefore, helps you to write better code straightaway.
Another feature of the PowerShell Script Analyzer is the ability to reformat PowerShell code to be more readable. You can configure numerous settings to define how the Script Analyzer should reformat your code.
Getting ready
How to do it...
- Discovering the Powershell Script Analyzer module
Find...