~/talk

Pimp Your Parameters: The Magic of Validation Classes

Talkat PowerShell + DevOps Global Summit 2026 · 2026-04-13..04-16· [typescript]
slides:none on file

Creates reusable classes that derive from ValidateArgumentsAttribute and implement a Validate(object arguments, EngineIntrinsics) method that throws on invalid and returns void, so bad input is rejected before function body runs. Demos include a ValidateIsNotFriday rule, a Jira ticket regex, a semver checker that strips leading v, enforces three parts, disallows components >999, a path validator that blocks UNC and “..” traversal and can restrict to a root, and a port validator that blocks well‑known ports by default. Note order matters — only first failure is reported and these work in PowerShell 5 where semver types are absent.

AI-written summary · about

  1. 0:00Validation classes intro
  2. 1:15Built-in validation recap
  3. 2:18Why custom validation matters
  4. 4:47Custom validation class
  5. 7:13Custom validation examples
  6. 10:46Constructors for validation
  7. 14:55Advanced validation scenarios
  8. 18:29Port and path validation
  9. 20:15Key takeaways
  10. 24:53Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.