Bird
0
0

How can you include multiple examples in comment-based help to show different ways to run a script?

hard📝 Application Q9 of 15
PowerShell - Functions
How can you include multiple examples in comment-based help to show different ways to run a script?
A<# .EXAMPLE Get-Process #> <# .EXAMPLE Get-Service #>
B<# .EXAMPLES Get-Process Get-Service #>
C<# .EXAMPLE Get-Process .EXAMPLE Get-Service #>
D<# .EXAMPLE Get-Process Get-Service #>
Step-by-Step Solution
Solution:
  1. Step 1: Understand .EXAMPLE usage

    Each example must be in its own .EXAMPLE section inside the same comment block.
  2. Step 2: Check options

    <# .EXAMPLE Get-Process .EXAMPLE Get-Service #> correctly uses multiple .EXAMPLE sections within one comment block.
  3. Final Answer:

    Multiple .EXAMPLE sections inside one comment block -> Option C
  4. Quick Check:

    Use multiple .EXAMPLE sections for multiple examples [OK]
Quick Trick: Use separate .EXAMPLE for each example inside one block [OK]
Common Mistakes:
  • Using .EXAMPLES (plural) which is invalid
  • Splitting examples into multiple comment blocks
  • Putting multiple examples under one .EXAMPLE without separation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes