How does the PowerShell Pipeline Concept work?
I understand that PowerShell piping works by taking the output of one cmdlet and passing it to another cmdlet as input. But how does it go about doing this? Does the first cmdlet finish and then pass all the output variables across at once, which are then processed by the next cmdlet? Or is each output from the first cmdlet taken one at a time and then run it through all of the remaining piped cmdlet’s? You can see how pipeline order works with a simple bit of script: function a {begin {Write-Host 'begin a'} process {Write-Host "process a: $_"; $_} end {Write-Host 'end a'}} function b {begin