Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Write-Warning cmdlet is designed to write a warning message to the screen. What’s cool about Write-Warning is that this message appears, by default, in bright yellow, making it clearly stand out in the console window:
Write-Warning is also one of the simplest of all cmdlets; all you do is call Write-Warning followed by the warning message you want to display:
Write-Warning "The folder C:\Scripts2 does not exist."
That’s all there is to it.