0
0
PowerShellscripting~10 mins

Comment-based help in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a comment-based help block in PowerShell.

PowerShell
<#[1]
This function says hello.
#>
Drag options to blanks, or click blank then click option'
A.PARAMETER
B.DESCRIPTION
C.SYNOPSIS
D.EXAMPLE
Attempts:
3 left
💡 Hint
Common Mistakes
Using .DESCRIPTION or .PARAMETER as the first line inside the help block.
Not starting the help block with <#.
2fill in blank
medium

Complete the code to add a parameter description in comment-based help.

PowerShell
<#
.PARAMETER Name
[1] the name to greet.
#>
Drag options to blanks, or click blank then click option'
ASpecifies
B.DESCRIPTION
CThis
D.SYNOPSIS
Attempts:
3 left
💡 Hint
Common Mistakes
Using another help keyword instead of a description.
Leaving the description incomplete.
3fill in blank
hard

Fix the error in the comment-based help block to properly close it.

PowerShell
<#
.SYNOPSIS
Says hello
[1]
Drag options to blanks, or click blank then click option'
A#>
B<#
C-->
D##
Attempts:
3 left
💡 Hint
Common Mistakes
Using <# again instead of closing.
Using HTML style --> which is invalid in PowerShell.
4fill in blank
hard

Fill both blanks to add an example section with a description in comment-based help.

PowerShell
<#
.EXAMPLE
[1]
[2]
#>
Drag options to blanks, or click blank then click option'
AGet-Greeting -Name 'Alice'
BThis example shows how to greet Alice.
CSays hello to Alice.
DGet-Help Get-Greeting
Attempts:
3 left
💡 Hint
Common Mistakes
Putting description before the example command.
Using unrelated commands in the example.
5fill in blank
hard

Fill all three blanks to create a full comment-based help block with synopsis, parameter, and example.

PowerShell
<#
.SYNOPSIS
[1]
.PARAMETER Name
[2]
.EXAMPLE
[3]
#>
Drag options to blanks, or click blank then click option'
ASays hello to a user.
BSpecifies the name of the user to greet.
CGet-Greeting -Name 'Bob'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of sections.
Leaving out the example or parameter description.