Become a parameter ninja
summary
Concrete rules for parameter design and real examples: use sensible defaults and aliases, accept names/IDs/objects and convert them, avoid Boolean flags, and watch type conversions (dates differ between get-date and functions because of local vs invariant culture). Shows an implemented argument completer and a Transformer for printers and path shortcuts that mostly works, warns that dynamic parameters caused about 100 server calls and a ~20s delay, and demonstrates enums and custom validators that give user-friendly errors.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:26Why parameter design matters
- 2:30Parameter naming rules
- 4:53Avoiding parameter type pitfalls
- 7:18Handling null and empty values
- 11:36Defaults and mandatory parameters
- 13:00Avoiding Boolean parameters
- 16:12Validation rules
- 21:45Using enums
- 23:12Argument completers
- 28:42Parameter sets
- 36:58Dynamic parameters caution
- 40:32Embedded completers explained
- 42:20PowerShell classes
- 45:33Transformers
- 50:20Custom validators
- 51:43Summary
related talks
48mMastering PowerShell Parameters: Advanced Techniques and Best Practices
26mPowerShell Oddities & Curiosities: Language Quirks You Forgot (or Never Knew)
01h 31mThe Full Show
01h 02m10 Opinions For Creating More Maintainable .NET Apps
01h 03mThe Zen of Powershell - PowerShell for the C# dev
44mEmpower your Helpdesk : Turn Scripts into Dynamic...
57mBuilding Better SSIS Packages
01h 11mWorkshop - Automating for DevOps
