Provides a set of choices that enable the user to choose a single option, a choice, from a set of options.
Namespace: System.Management.Automation.Host
Assembly: System.Management.Automation (in system.management.automation.dll)

Usage

Syntax
Public MustOverride Function PromptForChoice ( _
caption As String, _
message As String, _
choices As Collection(Of ChoiceDescription), _
defaultChoice As Integer _
) As Integer
public abstract int PromptForChoice (
string caption,
string message,
Collection<ChoiceDescription> choices,
int defaultChoice
)
public:
virtual int PromptForChoice (
String^ caption,
String^ message,
Collection<ChoiceDescription^>^ choices,
int defaultChoice
) abstract
public abstract int PromptForChoice (
String caption,
String message,
Collection<ChoiceDescription> choices,
int defaultChoice
)
public abstract function PromptForChoice (
caption : String,
message : String,
choices : Collection<ChoiceDescription>,
defaultChoice : int
) : int
Parameters
- caption
Text to proceed ( a title) the choices.
- message
A message that describes the choice.
- choices
A collection of ChoiceDescription objects that describe each choice.
- defaultChoice
-
Return Value
The index of the
Choices parameter collection element that corresponds to the option selected by the user.

Remarks

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms
Development Platforms
Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, Windows 7, Windows 2008 R2
Target Platforms
Windows Server 2008, Windows Server 2003, Windows Vista, Windows XP, Windows 7, Windows 2008 R2

See Also