Adding PowerShell Class Bells and Whistles
I hope you’ve been enjoying this series of articles on developing with PowerShell classes. As you’ve seen, creating a PowerShell class is not that difficult, but it does require a different paradigm than writing a PowerShell function. If you have a .NET developer background, PowerShell classes might feel inferior. And that’s because, in many ways, they are, and by design.
The PowerShell class syntax I’ve been demonstrating is for IT Pros who want the benefits of using a defined class but aren’t developers. The class syntax is written to leverage your PowerShell scripting skills. You don’t need Visual Studio. Your scripting editor is sufficient. Even the PowerShell ISE is aware of classes.
Classes defined as I’ve been demonstrating are not as feature-complete as they are in C# or other programming languages. But for IT Pros, this is more than sufficient. If you require more, you must turn to traditional programming sources.