Improving Your Attributes
summary
Dives into concrete parameter attributes: ValidateSet, ValidateRange, ValidateScript and regex examples that short‑circuit bad input, plus help and pipeline‑accepting flags. Demonstrates dynamic argument completers implemented as scriptblocks (parameters: commandName parameterName wordToComplete fakeBoundParameters), notes they run on every Tab, and shows using CompletionResult tooltips and Azure completers with caching. Shows writing class‑based argument transformation attributes that map usernames to GUIDs and shipping them in compiled modules; demos mostly work though some live calls fail.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:51PowerShell attributes matter
- 5:24Parameter attributes uses
- 7:13Validation attributes
- 14:19Help for parameters
- 17:08Dynamic argument completers
- 26:38Custom transformation attributes
- 32:40Q&A
related talks
45mPimp Your Parameters: The Magic of PowerShell Argument..
47mThe Human Side of PowerShell Scripting
45mBullet-proofing Patterns & Practices
56mAdvanced Scripting Using SSIS Script Tasks and Components
46mThe Joy of Intellisense: Tab Expansion
01h 45mWriting Award Winning PowerShell Functions and Script Modules
46mFrom Script to Tool: Building Robust, Meaningful Tools with PowerShell
45mA Crash Course in Writing Your Own PSScriptAnalyzer Rules
