If you feel like learning a third shell, I find that Nushell is even easier to use than PowerShell.
open stuff.json |each { get fieldName } |where { str starts-with "asdf" } |each { $in| str upcase }
This gets all the objects in the given json file, then grabs the value of the field named “fieldName”, then filters all those values to find the ones that start with and, converts those to uppercase, and prints them to the screen as a nicely formatted list
I take PowerShell ForEach-Object any day over the unholy contraptions of awk, xargs and friends in bash.
for $variable in $(collection command); doother-command $variable;doneHm TIL, fair enough. Thanks.
But chaining still seems harder than
CommandA | ForEach-Object { DoSomethingWith $_ } | CommandBIf you feel like learning a third shell, I find that Nushell is even easier to use than PowerShell.
open stuff.json | each { get fieldName } | where { str starts-with "asdf" } | each { $in | str upcase }This gets all the objects in the given json file, then grabs the value of the field named “fieldName”, then filters all those values to find the ones that start with and, converts those to uppercase, and prints them to the screen as a nicely formatted list