[Parameter(Mandatory = $false, HelpMsg = "The environment short codes array. Defaults to 'dev', 'qa', 'sit', 'uat' & 'pre' ")]
[string[]] $Environments = @('dev', 'qa', 'sit', 'uat', 'pre', 'prod') ) ```
There is no parameter Attribute property named HelpMsg
in Parameter Attribute object in ParameterAttributeClass. You can update the pipline instead HelpMsg
property with HelpMessage
as shown in below which worked in local environment.
[CmdletBinding()]
Param(
[Parameter(
Mandatory = $false,
HelpMessage= "The environment short codes array. Defaults to 'dev', 'qa', 'sit', 'uat' & 'pre'"
)]
[string[]] $Environments = @('dev', 'qa', 'sit', 'uat', 'pre', 'prod')
)
You can set the following properties with the ParameterAttribute object:
HelpMessage Property string HelpMessage {get;set;}
HelpMessageBaseName Property string HelpMessageBaseName {get;set;}
HelpMessageResourceId Property string HelpMessageResourceId {get;set;}
Mandatory Property bool Mandatory {get;set;}
ParameterSetName Property string ParameterSetName {get;set;}
Position Property int Position {get;set;}
ValueFromPipeline Property bool ValueFromPipeline {get;set;}
ValueFromPipelineByPropertyName Property bool ValueFromPipelineByPropertyName {get;set;}
ValueFromRemainingArguments Property bool ValueFromRemainingArguments {get;set;}
Here is the reference Azure documentation , discussing about each property of ParameterAttribute with Sample example.