Nice one SQL-DBA-01.
Have you thought of using:
Write-Error
Write-Warning
Write-Verbose
Write-Debug
Write-Progress
They can really help developing and using scripts. Also aids the self documenting aspect of it i.e. when appropriate why add a comment when you can add verbose description instead.
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!