Free tools Windows power users keep installed
One-click scans. No signup required.
Use -Verbose or -Debug on a command to request the corresponding message stream. These switches do not create output by themselves: the cmdlet, provider, script, or advanced function must emit verbose or debug messages. For scripts you control, use Write-Verbose and Write-Debug; use $VerbosePreference and $DebugPreference when you need broader control.
Turn on verbose output for one command
-Verbose is a PowerShell common parameter. It is available on cmdlets and on advanced functions that use CmdletBinding or a Parameter attribute. Add it to the command you are diagnosing:
As an Amazon Associate I earn from qualifying purchases.
Get-ChildItem -Path $env:TEMP -Verbose
The switch displays verbose messages only when that command generates them. Microsoft documents that the default value of $VerbosePreference is SilentlyContinue, so verbose messages are normally hidden: about_CommonParameters.
Write verbose messages in your own script
Write-Verbose sends text to PowerShell’s verbose message stream. It is intended for operational detail such as which file, endpoint, or processing phase a script is handling.
#1 Best Overall
- Book - powershell for sysadmins: workflow automation made easy
- Language: english
- Binding: paperback
Write-Verbose "Searching the Application Event Log."
With the normal preference, that message remains hidden. A caller can request it for the command or script:
.ackup.ps1 -Verbose
Within a command line, you can also force display for an individual call:
Write-Verbose "Searching the Application Event Log." -Verbose
See Microsoft’s Write-Verbose documentation for the stream behavior and command examples.
Recommended Free Tools
Show verbose messages through a preference variable
Set $VerbosePreference to Continue when you want verbose messages to display throughout the current scope or session:
$VerbosePreference = 'Continue'
Write-Verbose "Copying file $filename"
A preference variable affects more than a single command, so temporary changes in reusable code should be restored:
$oldVerbosePreference = $VerbosePreference
try {
$VerbosePreference = 'Continue'
Invoke-SomeOperation
}
finally {
$VerbosePreference = $oldVerbosePreference
}
Preference variables are scoped settings; a command-level -Verbose request is narrower and normally the safer first choice for one-off diagnosis. The available preference values and their behavior are documented in about_Preference_Variables.
Rank #3
Show debug output
Debug messages are a separate stream from verbose messages. Use -Debug with a command that emits debug messages:
Some-Command -Debug
Replace Some-Command with a real cmdlet or advanced function that implements debug messaging. For a guaranteed message from a script, use:
Write-Debug "Checking input" -Debug
Write-Debug is intended for programmer-oriented troubleshooting, such as inspecting decisions, internal state, or branch selection. Its behavior can include an interactive debugging response depending on $DebugPreference and the host, so do not assume every terminal will prompt identically.
Rank #4
To enable debug messages more broadly, set the preference variable:
$DebugPreference = 'Continue'
Write-Debug "Checking input"
PowerShell’s default debug behavior and preference values are described in about_Preference_Variables; common-parameter behavior is covered by about_CommonParameters.
Verbose versus debug: which should you use?
| Aspect | Verbose | Debug |
|---|---|---|
| Purpose | Operational progress and processing detail | Technical troubleshooting and internal decisions |
| Script cmdlet | Write-Verbose |
Write-Debug |
| Command switch | -Verbose |
-Debug |
| Preference variable | $VerbosePreference |
$DebugPreference |
| Default display | Hidden when the preference is SilentlyContinue |
Hidden by default |
| Requirement | The command must actually generate messages on that stream | |
A practical troubleshooting sequence
- Try the narrowest switch. Run the specific cmdlet with
-Verbose. - Check whether the command supports common parameters. Cmdlets and advanced functions normally do; a basic function may not.
- Try debug output separately. Add
-Debugif the operation needs implementation-level detail. - Inspect the script’s message calls. Look for
Write-VerboseorWrite-Debug; a command that contains neither cannot display those streams. - Use a preference variable only for wider diagnosis. Set it in the required scope, then restore the previous value when the diagnostic operation ends.
Why nothing appears
- The command completed without emitting a message of the requested type.
- The function is not an advanced function and therefore does not expose common parameters such as
-Verboseor-Debug. - The relevant preference variable is still suppressing the stream.
- You enabled verbose output while the information you need is emitted on the debug stream, or vice versa.
- The message is written to another stream, such as standard output, warning, or error, rather than the verbose or debug stream.
Design guidance for script authors
Use verbose for users operating the script
Report meaningful milestones, selected resources, and non-error decisions with Write-Verbose. Keep normal output reserved for data the caller expects to consume.
Best Value
Use debug for implementation details
Put low-level state and branch diagnostics in Write-Debug so routine verbose runs remain readable.
Enable common parameters in advanced functions
Add [CmdletBinding()] to a function that should participate in PowerShell’s common-parameter system, then use Write-Verbose or Write-Debug at the decision points where the messages are useful.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




