logoalt Hacker News

thewebguydyesterday at 6:04 PM2 repliesview on HN

> 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.


Replies

ACS_Solveryesterday at 7:32 PM

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.

d3Xt3ryesterday at 6:49 PM

You can skip the `| Select` btw.

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