The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,991 other followers

Archive for June 17th, 2014

Thanks Jaykul for explaining me a custom PowerShell script that acts like DU (DiskUsage).

Posted by jpluimers on 2014/06/17

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 »

Posted in Development, PowerShell, Scripting, Software Development | 1 Comment »

 
%d bloggers like this: