Returns choice selected from a list of options.
Read-Choice.ps1 [-Choices] <String[]> [-Caption <String>] [-Message <String>] [-DefaultIndex <Int32>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Read-Choice.ps1 [-ChoiceHash] <IDictionary> [-Caption <String>] [-Message <String>] [-DefaultIndex <Int32>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Read-Choice.ps1 one,two,three
Please select: [] one [] two [] three [?] Help (default is “one”): one
Read-Choice.ps1 ([ordered]@{'&one'='first thing';'&two'='second thing';'t&hree'='third thing'}) -Message 'Pick:'
Pick: [O] one [T] two [H] three [?] Help (default is “O”): ? O - first thing T - second thing H - third thing [O] one [T] two [H] three [?] Help (default is “O”): &one
A list of choice strings. Use & in front of a letter to make it a hotkey.
Type: String[]
Parameter Sets: ChoicesArray
Aliases: Options
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
An ordered hash of choices mapped to help text descriptions. Use & in front of a letter to make it a hotkey.
Type: IDictionary
Parameter Sets: ChoicesHash
Aliases: Menu
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A title to use for the prompt.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Instructional text to provide in the prompt.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Please select:
Accept pipeline input: False
Accept wildcard characters: False
The index of the default choice. Use -1 to for no default. Otherwise, the first item (index 0) is the default.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.