Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Defines the choices presented to the user and returns the choices made by the user. This method is introduced in Windows PowerShell 2.0.

Namespace:   System.Management.Automation.Host
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

Function PromptForChoice (
	caption As String,
	message As String,
	choices As Collection(Of ChoiceDescription),
	defaultChoices As IEnumerable(Of Integer)
) As Collection(Of Integer)

Parameters

caption
Type: System.String

Text (a title) to precede the choices.

message
Type: System.String

A message that describes the choices.

choices
Type: System.Collections.ObjectModel.Collection(Of ChoiceDescription)

A collection of ChoiceDescription objects that describe each choice.

defaultChoices
Type: System.Collections.Generic.IEnumerable(Of Int32)

The index of the labels in the Choices parameter collection. These elements are displayed to the user as the default choices. To indicate no default choices, set to -1.

Return Value

Type: System.Collections.ObjectModel.Collection(Of Int32)

Returns a Collection(Of T) object that contains the indices of the Choices parameter collection elements that the user selected.

To provide a set of choices that allow the user to select a single choices, see the PSHostUserInterface.PromptForChoice method.

Return to top

Community Additions

Show: