I have written my own Powershell logging function Log
with parameters stream
(on which stream to write the message) and message
(the messa
Also available: Check the parameter '$VerbosePreference'. If it is set to 'SilentlyContinue' then $Verbose was not given at the command line. If it is set to '$Continue' then you can assume it was set.
Also applies to the following other common parameters:
Name Value
---- -----
DebugPreference SilentlyContinue
VerbosePreference SilentlyContinue
ProgressPreference Continue
ErrorActionPreference Continue
WhatIfPreference 0
WarningPreference Continue
ConfirmPreference High
Taken from an MSDN blog page from long ago... so it should be relevant with relatively old versions of Powershell. Also see "Get-Help about_CommonParameters" in Powershell v4.