Hacker News new | ask | show | jobs
by thewebguyd 18 days ago
> outputs being objects is a really solid take.

Glad I'm not alone here ha!

Being able to go someoutput | Format-Table | Select ColumnName,ColumnName,CloumnName is great. Beats memorizing the output format of any specific command and trying to wrangle it with awk.

3 comments

I'm a big Linux advocate with limited experience on modern versions of Windows, but PowerShell objects are great. So is the Unix way of doing text. I think the strengths of each approach are in different use cases. Unix style is better for interactive usage because it's fast, I can type df -h | grep /home very quickly. Object output is better for scripts that can, thanks to objects, store and operate on sensible data while Bash scripts do a lot of ad-hoc data extraction/reformatting with string expansion, awk and whatever else to get data to the next step in the script.
Inspired by the ways of Xerox, Genera and ETHZ.

It can be verbose, but the object approach, and having .NET, DLLs and COM as first class primitives is quite flexible.

Naturally you can have a similar experience on UNIX, e.g. fish, but very few do it.

You can skip the `| Select` btw.

Just do `someoutput | ft ColumnName,ColumnName,CloumnName`