Powershell feels like it was designed by people who expect the underlying app to natively structure its data before handing it off to the shell. Typical Microsoft, acting like they own the place and expecting others to conform.
Nushell on the other hand takes the (IMO more pragmatic) stance that the underlying app will most likely be writing strings to stdout and it's the shell's job to make it easy to discern the structure in those strings.
Perhaps a powershell wizard can show me that I'm wrong about this, but my feeling is that the powershell equivalent to this nushell is going to either call some external program (in addition to docker) or be quite messy:
$ docker ps | detect columns | where NAME == "foo"
I think the Powershell cmdlet "ConvertFrom-Csv" does functionally the same thing as "detect columns" in nushell. Though in this case it's probably better to make docker output structured data using "--format '{{json .}}'" and parse that instead of the human-readable representation.
Re: just asking for structured output and parsing it accordingly--you're absolutely right. Do that if you can.
But merely concatenating processes which emit and consume data of known shape is something that the OS can do without an interactive shell. What you really need a shell for is those situations where a bit of duct tape and string is needed to keep the bits flowing... when "--format '{{json .}}'" doesn't work.
Re: ConvertFrom-Csv, touche, but I'm going to guess that it's not prepared to handle cases where the delimiter also appears in the output (spaces in this case).
$ docker ps | detect columns | select CREATED STATUS | get 1 # ConvertFrom-Csv equivalent
╭─────────┬───────╮
│ CREATED │ weeks │
│ STATUS │ 9 │
╰─────────┴───────╯
Nushell's answer here is --guess, which counts characters to determine how far from the left the column starts.
$ docker ps | detect columns --guess | select CREATED STATUS | get 1
╭─────────┬─────────────╮
│ CREATED │ 2 weeks ago │
│ STATUS │ Up 9 days │
╰─────────┴─────────────╯
I'm not trying to bash pwsh, It's just that they're just trying to be different kinds of thing.
It’s available in other OSs now, but my exposure to it has mainly been windows server and endpoint environments.
YMMV, I’m mainly speaking from my own experience/history with powershell. For a long time it was the only way I knew of to manage various aspects of low level windows OS settings.
Gotcha. Speaking as someone who isn’t a fan of windows after about windows 2000, powershell is quite powerful, if not a touch verbose. Worth reading up on if you have a need to use it on any kind of cadence.
I wish nushell and pwsh got together. Structured data shells are great, scraping is brittle, but they’re both trying to do the same thing and people should be able to compile native cmdlet type things using whatever language they like. Both projects, although great, have failed independently to create a popular structured data shell. Together they could actually do it.