Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

An example when using Write-Host makes sense

$
0
0

In the PowerShell community, there is some debate about the usage of the Write-Host cmdlet.  The debate stems from the fact that the output of the Write-Host cmdlet places strings of text on the monitor and not in the pipeline.  Since PowerShell cmdlets are supposed to create objects  some may think you are developing poor code should you be caught using Write-Host.  I personally beg to differ.  Although nicely formatted columns can present data in a very orderly package, too much displayed information can hide what is requiring the user’s attention. This is where the Write-Host cmdlet can excel.  For the novice user, the color formatting capabilities of the Write-Host cmdlet can be used to highlight what needs their attention and focuses them on the task at hand.

Read More


Viewing all articles
Browse latest Browse all 8583

Trending Articles