Skip to content

Built-in Help

With the the dadjokes module imported, you can get help in the terminal with the Get-Help command. The help system is one of the many neat features of PowerShell. The format of help for every function or cmdlet has the same schema. And even if you don't document anything, you still get some basic information about the expected parameters, parameter types, and which parameters (if any) are required when using the command.

In the sample dadjoke module, I intentionally added comment-based help for Get-DadJoke and not for Find-DadJoke. You can see in the Find-DadJoke tab below that the built-in help system still gives you a good idea of how to use the command, and thanks to the use of the [OutputType()] attribute, it even declares the output type for the command.

Command
1
Get-Command -Module dadjokes | Get-Help -Full
NAME
    Get-DadJoke

SYNOPSIS
    Gets a dad joke from the icanhazdadjoke.com API.


SYNTAX
    Get-DadJoke [[-JokeId] <String>] [<CommonParameters>]


DESCRIPTION
    Gets a dad joke from the icanhazdadjoke.com API.


PARAMETERS
    -JokeId <String>
        Specifies an optional joke Id.

        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216). 

INPUTS

OUTPUTS
    DadJoke


    -------------------------- EXAMPLE 1 --------------------------

    PS > Get-DadJoke

    Gets a dad joke, but can't help you "get" the dad joke.





RELATED LINKS
    https://icanhazdadjoke.com/api
NAME
    Find-DadJoke

SYNTAX
    Find-DadJoke [[-Term] <string>] [<CommonParameters>]


PARAMETERS
    -Term <string>

        Required?                    false
        Position?                    0
        Accept pipeline input?       false
        Parameter set name           (All)
        Aliases                      None
        Dynamic?                     false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216). 


INPUTS
    None


OUTPUTS
    DadJoke


ALIASES
    None


REMARKS
    None