PowerShell Script Analyzer: Good, consistent and pretty code
summary
PSScriptAnalyzer lints PowerShell by walking the AST inspection and applying built‑in and custom rules; several rules expose a fix parameter so the analyzer can auto-fix suggestions like replacing aliases, reindenting, or remove trailing whitespace. Demo runs on a ~4,000‑line script show the fixer removed 503 trailing spaces; an experimental repo tool generates one commit per file with fixes (testing it on a 120,000‑line codebase succeeded but the customer asked not to run it again). Integration into CI and editor formatting also works.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:40Good code
- 4:41Script Analyzer
- 7:22Debate Demo
- 8:37AST
- 10:12Script blocks
- 12:13Script analyzer rules
- 16:09AD Health Check
- 18:04Remove all spaces
- 21:02Suggested correction
- 23:29Bad script
- 25:28What if
- 30:34extendable
- 35:15PowerShell Script Analyzer
- 37:25Format Selection
related talks
31mHow to Satisfy Your OCD with PowerShell Code and Tools
01h 03mThe Zen of Powershell - PowerShell for the C# dev
43mPowerShell For Every System
34mWhip Your Scripts into Shape: Optimizing PowerShell for Speed
45mGitHub Actions for Fun and Profit
01h 07mPowerShell: Designed for a Messy World
10mHow can you use prompt engineering to debug PowerShell?
41mPowerShell for Life: Automate the Everyday
