Broadly speaking, when the output of a cmdlet is piped to the input of another cmdlet, the first object is retrieved and will get processed. While this happens, the second object will be retrieved. This process continues until the flow of objects has stopped and there is nothing more to process. A clean-up task might occur.
Let's visualize this in a function that accepts pipeline input—more on that in Chapter 5, Writing Reusable Code. The following code sample is a very simple function accepting entire objects from the pipeline:
function UsesPipeline{ param ( [Parameter(ValueFromPipeline)] [string] $PipedObject ) begin { # Optional - will be executed once before any object is retrieved from the pipeline # Usually used to initialize ...