0
0
PowerShellscripting~5 mins

Verbose and debug output in PowerShell - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of verbose output in PowerShell scripts?
Verbose output provides extra details about what a script is doing. It helps you understand the steps the script takes without changing the main output.
Click to reveal answer
beginner
How do you enable verbose messages when running a PowerShell script?
Use the -Verbose switch when running the script or command. For example: .\script.ps1 -Verbose.
Click to reveal answer
intermediate
What is the difference between verbose output and debug output in PowerShell?
Verbose output shows extra information about normal script steps. Debug output shows detailed info mainly for troubleshooting and is usually more technical.
Click to reveal answer
beginner
How do you write a debug message inside a PowerShell script?
Use the <code>Write-Debug</code> cmdlet followed by your message. For example: <code>Write-Debug "This is a debug message"</code>.
Click to reveal answer
beginner
How can you enable debug messages when running a PowerShell script?
Use the -Debug switch when running the script or command. For example: .\script.ps1 -Debug.
Click to reveal answer
Which switch shows verbose messages when running a PowerShell script?
A-Debug
B-Verbose
C-Trace
D-Info
What cmdlet do you use to write a debug message inside a PowerShell script?
AWrite-Verbose
BWrite-Output
CWrite-Debug
DWrite-Error
If you want to see debug messages, which switch should you add when running a script?
A-Debug
B-ShowDebug
C-Verbose
D-Trace
Verbose output is best described as:
AExtra details about script steps
BFinal script output
CUser input prompts
DError messages only
Which cmdlet would NOT show output unless its switch is enabled?
AWrite-Error
BWrite-Output
CWrite-Host
DWrite-Verbose
Explain how to add verbose and debug messages in a PowerShell script and how to enable them when running the script.
Think about the cmdlets and switches that control extra output.
You got /4 concepts.
    Describe the difference between verbose output and debug output in PowerShell and when you might use each.
    Consider the purpose and detail level of each output type.
    You got /4 concepts.