The Rise and Fall of Microsoft Certificates
Why did Don Jones say that using Write Host kills a puppy?
Don Jones, a highly experienced author, MVP, and PowerShell expert, famously once said that every time you use Write-Host, you kill a puppy. See Jeffrey Snover's blog for more information.
So, why is it considered so bad? Because it messes with the output streams.
Consider a PowerShell script file with the following two lines.
"This is a test message."
"This is a test message written to Write-Host." | Write-Host
When you run this and redirect the output to a text file, the second message is written to the screen and not written to the text file.
This means that if you run the script from inside some other system, for example a SQL Server Agent job, then you won't be able to capture the output, which is bad.
There are a lot of articles on the web discussing the issue in more detail. Here are a couple that I like.
Write-Host – The gremlin of PowerShell, by Jeff Wouters
Puppycide done right - output versus messages