I have written my own Powershell logging function Log with parameters stream (on which stream to write the message) and message (the messa
Log
stream
message
Inside your script check this:
$PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent