|
|
|
|
|
by smoldesu
1149 days ago
|
|
It's not that bad. I'm mostly balking at the idea of `ConvertFrom-Json | ForEach-Object { $_.name }` being any easier to remember than `jq '.[].name' -r`. Both examples seem to "convert" text to JSON with a parser, it's like arguing over the difference between awk and catting into grep. Neither really seem more advantageous than the other. |
|
`$someJsonText | convertfrom-json | % name`
the `| % [property name]` is shorthand for pulling out some root level property on an object in the pipeline
(just for reference; not really trying to prove any point)
What I personally like about PS in this case is that the syntax of the operation feels very consistent with the rest of powershell, but that's not a dig against jq (I use it a lot when I'm on macos); just my subjective impression, and not an objective claim of quality.