3 ms·
PowerShell has the best pipeline capability of any language I have ever seen. For comparison, UNIX pipes support only trivial byte streams from output to input
by jiggawatts 2y ago
PowerShell has the best pipeline capability of any language I have ever seen.
For comparison, UNIX pipes support only trivial byte streams from output to input.
PowerShell allows typed object streams where the properties of the object are automatically wired up to named parameters of the commands on the pipeline.
Outputs at any stage can not only be wired directly to the next stage but also captured into named variables for use later in the pipeline.
Every command in the pipeline also gets begin/end/cancel handlers automatically invoked so you can set up accumulators, authentication, or whatever.
UNIX scripting advocates don’t know what they’re missing out on…
- account-5 2y agoYou should look at Nushell. Much as I like powershell, Nushell just seems better.
- jiggawatts 2y agoI’d love to, but even the core concepts like pipeline behaviour aren’t documented. There’s just a bunch of empty headings: https://www.nushell.sh/lang-guide/chapters/pipelines.html https://www.nushell.sh/lang-guide/chapters/pipelines.html
- account-5 2y agoYeah, it's younger than powershell so there's some rough edges in some places. I wouldn't let empty headings in the docs stop you using/experimenting with it though. I use powershell daily but am hopeful that I can replace it with Nushell at some point.
- replwoacause 2y agoCompletely agree. PowerShell is what got me hooked on scripting/programming and the pipeline is such an elegant construct.