Today I saw an article from Christian Ritter, “PowerShell: Creating an “empty” PSCustomObject” on X that got me curious. Do people create empty objects like Christian proposes? I want to offer an alternative to Christian’s article, which uses OrderedDictionary and converts to PSCustomObject.
Today’s story happened a few days back to me, and I think many people may not even know about some object behaviors in PowerShell (just like me). I know some of you may think this is basic PowerShell knowledge but even thou I’ve written a lot of different PowerShell modules I kind of skipped basics. That means I often find myself struggling with something that’s obvious if you’ve done your due diligence before starting to work with the code. But that’s typical me, playing with complicated stuff, failing at simple things.