Re: ForEach loops and output to the pipeline.
It's admittedly not something you see done very often (normally you see the result set to a variable, or more fequently an empty array initialized and then results added to that as they are produced within the loop). I didn't quite grasp the way script blocks accumulate objects and then return them to the pipeline until I got to looking into them further. Once I figured that out, other constructs began to make more sense, and using them became more intuitive.
I understand this may be somewhat outside of the intended scope of the book......
|