Exercise 1: Why Show-NameBroken Only Prints "Carol" — Possible Solution ==================================================================== WHY ONLY ONE LINE PRINTS ------------------------------ Per this chapter, a function body written as one plain block - with no begin/process/end - runs exactly once, no matter how many objects the pipeline sends into it. Show-NameBroken's "Name is: $Name" line sits directly in the function body, not inside a process {} block, so it only executes a single time for the entire pipeline. By the time that single execution happens, the pipeline-bound $Name parameter only still holds the LAST object that was piped in - "Carol" - because each new pipeline item overwrites the parameter's value as it arrives, and nothing captures or acts on the earlier ones before they're overwritten. WHY process{} WOULD FIX IT ------------------------------ Per this chapter, process {} is the one block that runs once PER pipeline object, rather than once total. Show-NameFixed moves the exact same "Name is: $Name" line inside process {}, which is why it correctly prints all three names ("Alice", "Bob", "Carol") instead of just the last one - the block itself re-executes for every single object the pipeline delivers. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that a plain function body executes only once regardless of pipeline input size, correctly identifies that the pipeline-bound parameter only retains the last-received value by the time that single execution runs, and correctly contrasts this with process {}'s per-object execution model as the actual fix.