Developing with PowerShell Classes: Here be Dragons
summary
Dives into concrete PowerShell 5 class gotchas with demos from a real project PoshBot showing what actually breaks and how to work around it: classes must live in the PSM1 or they won’t be exposed, using module exposes types but Import-Module and RequiredModules do not, module versioning and import semantics behave oddly, class file order affects inheritance, and verbose/debug streams and hidden properties have surprising behavior. Several pragmatic fixes are shown (build-time concatenation, factory functions, runtime checks) but many are kludges not clean fixes.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:47Demos
- 1:04Agenda
- 1:58Examples
- 3:10Why use classes
- 12:20Remove Hard Dependency
- 12:33Remove Soft Dependency
- 16:40Importing Classes
- 18:49Hidden Properties
- 21:10verbose in debug
- 25:13requires module
- 30:13complex module
- 37:13abstract classes
- 40:43parameter validation
related talks
01h 03mThe Zen of Powershell - PowerShell for the C# dev
46mFrom Script to Tool: Building Robust, Meaningful Tools with PowerShell
01h 30mConjuring data with APIs
26mPowerShell Oddities & Curiosities: Language Quirks You Forgot (or Never Knew)
01h 29mModularizing PowerShell: Making Code Portable
03h 04mMastering Making Modules
45mPlatform PowerShell
01h 07mPowerShell: Designed for a Messy World
