Write-Verbose
Use Write-Verbose to write a diagnostic message that stays hidden unless the caller asks for it with -Verbose.
Documentation: Microsoft Learn — Write-Verbose
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Write-Verbose [-Message] <String> [<CommonParameters>]- Stage 1Write-Verbose
-Message
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Write-Verbose -Verbose
Show reference output
Sample output · fictional data, shaped like the real thing
VERBOSE: Connecting to WEB01
Write-Verbose -Verbose (2)
Show reference output
Sample output · fictional data, shaped like the real thing
VERBOSE: checking
Write-Verbose -Verbose (3)
Show reference output
Sample output · fictional data, shaped like the real thing
VERBOSE: Retry count is 3
Parameters
Parameter definitions:
-Message
Practical use and troubleshooting
Practical scenario: Use Write-Verbose when you need to write a diagnostic message that stays hidden unless the caller asks for it with -Verbose. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: No visible message often means verbose output is disabled. Invoke the advanced command with -Verbose or configure VerbosePreference deliberately; keep credentials out of diagnostic text. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Write-Debug. Write-Verbose provides optional operational detail; Write-Debug provides debugging detail. Their visibility is controlled separately and neither should be used as ordinary function return data. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Write-Verbose Use Write-Verbose to write a diagnostic message that stays hidden unless the caller asks for it with -Verbose.
Next: Write-Debug