Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Write-Host vs Write-Output

$
0
0

I think it’s about the principles of tool design. If that was my goal, I’d write one function named Test-ICMP. That would do the ping, and output objects to the pipeline by using Write-Output. I’d write a second command, Format-ICMPResults, that accepted those objects on the pipeline and formatted them for screen display. That way, I could use Test-ICMP in other places, but when I wanted colored formatting I could have it. The verb “Format” tells me that the results are for display only, so I wouldn’t expect to be able to do something with the objects after formatting them.


Viewing all articles
Browse latest Browse all 13067

Latest Images

Trending Articles



Latest Images