IHostUISupportsMultipleChoiceSelection.PromptForChoice(String, String, Collection<ChoiceDescription>, IEnumerable<Int32>) IHostUISupportsMultipleChoiceSelection.PromptForChoice(String, String, Collection<ChoiceDescription>, IEnumerable<Int32>) IHostUISupportsMultipleChoiceSelection.PromptForChoice(String, String, Collection<ChoiceDescription>, IEnumerable<Int32>) Method

Definition

Presents a dialog allowing the user to choose options from a set of options.

public System.Collections.ObjectModel.Collection<int> PromptForChoice (string caption, string message, System.Collections.ObjectModel.Collection<System.Management.Automation.Host.ChoiceDescription> choices, System.Collections.Generic.IEnumerable<int> defaultChoices);
abstract member PromptForChoice : string * string * System.Collections.ObjectModel.Collection<System.Management.Automation.Host.ChoiceDescription> * seq<int> -> System.Collections.ObjectModel.Collection<int>
Public Function PromptForChoice (caption As String, message As String, choices As Collection(Of ChoiceDescription), defaultChoices As IEnumerable(Of Integer)) As Collection(Of Integer)
Parameters
caption
String String String

Caption to precede or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)"

message
String String String

A message that describes what the choice is for.

choices
Collection<ChoiceDescription>

An Collection of ChoiceDescription objects that describe each choice.

defaultChoices
IEnumerable<Int32>

The index of the labels in the choices collection element to be presented to the user as the default choice(s).

Returns

The indices of the choice elements that corresponds to the options selected. The returned collection may contain duplicates depending on a particular host implementation.

Applies to