|
|
|
|
|
by ab5tract
588 days ago
|
|
I’m not sure that I see the connection that you are making here. Can you elaborate? Also note that in contrast to Bash, Junction is a type. Regarding their utility, at their most useful level (in my experience), junctions provide for things like: $string ~~ “this”|”that”|”other”
This is the same as writing $string eq “this” || $string eq “that” || $string eq “other”
They have many other uses but that’s the most common one that I tend to see in practice. |
|
Back when I had to write PowerShell scripts, I constantly found that piping an array to some command would almost always make that command to be invoked once for every item in array, instead of being invoked once and given the whole array as a single input. Sometimes it's the latter that you need, so the workaround is to make a new, single-element array with the original array as its only element, and pipe this into the command.