Thanks Joel Bennett (aka Jaykul) from Huddled Masses for answering my Stack Overflow question PowerShell Get-DiskUsage CmdLet: how to list from a different drive/directory?
In addition to answering it, he also added a complete new and lighter implementation of that script explaining why it was lighter and what idioms to follow in PowerShell.
After reading his aswer, I was even more aware of these two things than I was before:
- I should emphasize the importance of the object pipeline even more than I already did.
- You should try to cut down on the dynamically instantiated objects. Like any language with heavy objects, they provide the huge benefit of fast development, but also an inherent cost.
I wasn’t aware you can put your own crafted objects into the pipeline in a very easy way. But you can: Read the rest of this entry »