February 2019
Intermediate to advanced
626 pages
15h 51m
English
HelpMessage is only applied to Mandatory parameters and is not particularly useful. If a parameter is mandatory and is not passed when a command is called, a prompt for the parameter value will appear. Typing !? in the prompt, instead of a value, will display the help message text:
PS> function Test-HelpMessage {>> param (>> [Parameter(Mandatory, HelpMessage = 'Help text for Parameter1')]>> $Parameter1>> )>> }PS> Test-HelpMessagecmdlet Test-HelpMessage at command pipeline position 1Supply values for the following parameters:(Type !? for Help.)Parameter1: !?Help text for Parameter1Parameter1:
Given that HelpMessage is only visible when explicitly requested in this manner, it is most often ignored entirely. It is better ...
Read now
Unlock full access