I use PSObject all the time. Now when I write scripts I nearly always output an object and unless I can just add to an existing type that is close, I create my own. I copied from one of my recent ones below to show how I do it. Now this isn’t a complete script. …
Tag: Custom
Using Add-Member in a Powershell One-Liner to Create Calculated Properties
This is one of the live demos I do when I teach class. Its a slightly advanced concept for some of my students as it deals with object members. It is actually fairly nice looking code and I love the fact that I can maintain my original object (instead of say changing to a PSCustom…