Depend on objects, not their presentation

The most recent blog post by Jeffrey Snover emphasizes that PowerShell pipes objects, not text. When you use single PowerShell commands, you can get the impression that they output text. But everything is an object until the pipeline spills onto the command line.

In UNIX, text output is effectively a programming contract because that is what the whole system is built upon. One command outputs text and other programs know what to expect so they parse the text to get the appropriate data elements so that they can code against it. In this model, if you change the text output of a command—you run the risk of breaking a bunch of scripts. … In PowerShell … We reserve the right to radically change our text rendering to improve our customer experience.

(Emphasis in the original.)

The object interfaces won’t change, but the text rendering probably will.

Leave a Reply

Your email address will not be published.