IHostUISupportsMultipleChoiceSelection.PromptForChoice Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Presents a dialog allowing the user to choose options from a set of options.
public:
System::Collections::ObjectModel::Collection<int> ^ PromptForChoice(System::String ^ caption, System::String ^ message, System::Collections::ObjectModel::Collection<System::Management::Automation::Host::ChoiceDescription ^> ^ choices, System::Collections::Generic::IEnumerable<int> ^ defaultChoices);
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);
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
Caption to precede or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)"
- message
- 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.