As im starting to use PowerShell more, im trying to clean up my code use functions/error checking etc.  One of the other things that ive seen the pro’s use is colour coding of their write-host remarks.

To keep things simple im going to try and keep my write-Host to a simple standard of:

Error Message: Red

Warning Message: Yellow

Success/Completed: Green

##
## Colour coding Standards
##
## Error Message
Write-Host "Error: code" -ForegroundColor Red
## Warning Message
Write-Host "Warning: code" -ForegroundColor yellow
## Success Message
Write-Host "Sucess: code" -ForegroundColor green

ColourCoding

Advertisements