Bird
0
0

What will be the output when running this script with -Verbose?

medium📝 Command Output Q13 of 15
PowerShell - Scripting Best Practices
What will be the output when running this script with -Verbose?
Write-Verbose "Starting process"
Write-Output "Process running"
Write-Verbose "Process completed"
ANo output
BProcess running
CProcess running\nStarting process\nProcess completed
DStarting process\nProcess running\nProcess completed
Step-by-Step Solution
Solution:
  1. Step 1: Understand Write-Verbose output with -Verbose

    When run with -Verbose, all Write-Verbose messages show along with normal output.
  2. Step 2: Identify output order

    The script writes verbose messages "Starting process" and "Process completed" plus the normal output "Process running" in order.
  3. Final Answer:

    Starting process Process running Process completed -> Option D
  4. Quick Check:

    Verbose + Output = all messages shown [OK]
Quick Trick: Verbose messages show only with -Verbose, normal output always shows [OK]
Common Mistakes:
  • Ignoring verbose messages in output
  • Assuming verbose messages appear without -Verbose
  • Mixing order of output lines

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes