Write-Verbose
SYNOPSIS
Writes a string to the verbose display of the host.
SYNTAX
Write-Verbose [-message] <string> [<CommonParameters>]
DETAILED DESCRIPTION
Writes a string to the verbose display of the host. The value of the $VerbosePreference variable determines whether or not the string is displayed in the console window. To see the value of the variable, type $VerbosePreference. Valid values are: SilentlyContinue, Stop, Continue and Inquire. To set the value of the variable in the current session, type $VerbosePreference = "<value>". If $VerbosePreference is set to SilentlyContinue, running Write-Verbose does not display anything to the console. For all other values of $verbosepreference, the cmdlet displays its message to the console and either continues, stops or asks the user whether it should continue.
Using the Write-Verbose cmdlet to display detailed information in a script lets the users of the script control whether or not to display that detailed information by setting the value of the $VerbosePreference variable.
PARAMETERS
-message <string>
Specifies the message to display.
Required? |
true |
Position? |
1 |
Default value |
|
Accept pipeline input? |
true (ByValue) |
Accept wildcard characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".
INPUT TYPE
String
NOTES
For more information, type "Get-Help Write-Verbose -detailed". For technical information, type "Get-Help Write-Verbose -full".
When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".
EXAMPLE 1
$verbosepreference = "silentlycontinue"
write-verbose "test"
$verboseprefernce = "continue"
write-verbose "test"
This command sets the $verbosepreference variable to SilentlyContinue. It then uses the Write-Verbose cmdlet to display the message 'test'. Nothing is displayed because of the value of the $verbosepreference variable. The $verbose preference variable value is then changed to Continue and the next call to Write-Verbose displays the message 'test' as a result.
RELATED LINKS