Write a warning message in reverse video to the host display.
Syntax
Write-Warning [-message] string [CommonParameters]
Key
-message string
The warning message to send to the host.
{may be piped}
CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.
The action of Write-Warning is dependent on the value of $WarningPreference
"Continue" = Show the message on the console [this is the Default action]
"SilentlyContinue" = Do not show the message.
"Stop" = Show the message and then halt.
"Inquire" = Prompt the user.
Example
Write a warning message:
PS C:\>$WarningPreference = "Continue"
PS C:\>Write-Verbose "The quick brown fox."
“History is a vast early warning system” - Norman Cousins
Related Powershell Commands:
Write-Debug - Write a debug message to the host display
Write-Error - Write an object to the error pipeline.
Write-Host - Display objects through the host user interface
Write-Output - Write an object to the pipeline
Write-Progress - Display a progress bar
Write-Verbose - Write a string to the host’s verbose display