Exercise 1: Why Get-OldFileReport Uses Write-Verbose Throughout — Possible Solution ==================================================================== WHY WRITE-VERBOSE IS USED INSTEAD OF A BARE STRING OR WRITE-OUTPUT ------------------------------ Per Chapter 7, every uncaptured line inside a function joins that function's return value - not just what follows return. Get-OldFileReport is meant to return exactly one clean value: the $results array of report objects. If any progress message used a bare string or Write-Output instead of Write-Verbose, that message would become an additional, unwanted element mixed into the function's actual return value, exactly like Chapter 7's own Get-Doubled example, where an innocent-looking Write-Output call turned a single expected value into a two-element array. Write-Verbose writes to a genuinely separate stream that never joins the return value under any circumstances, and stays silent by default unless -Verbose is explicitly passed - letting Dana see progress during a -Verbose run without ever risking the report's own data. WHAT WOULD GO WRONG WITH A STRAY WRITE-OUTPUT LINE ------------------------------ If a stray Write-Output "Deleting $($file.Name)..." line were added inside the foreach loop in Step 7, every one of those status strings would get mixed directly into whatever $results ends up holding (or whatever the function returns at that point) - turning a clean array of report objects into an array contaminated with status-message strings jumbled in. Anything downstream depending on $results being purely report objects (like Export-Csv or ConvertTo-Json) would then process a corrupted mixed collection instead of the clean data it expects. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that Write-Verbose avoids joining the return value entirely, correctly connects this to Chapter 7's own uncaptured-output rule and its Get-Doubled example, and correctly describes the concrete corruption that a stray Write-Output call would cause to the function's actual returned data.