Provides a set of choices that enable the user to choose a single option from a set of options.
Namespace: System.Management.Automation.Host
Assembly: System.Management.Automation (in system.management.automation.dll)
Dim instance As PSHostUserInterface
Dim caption As String
Dim message As String
Dim choices As Collection(Of ChoiceDescription)
Dim defaultChoice As Integer
Dim returnValue As Integer
returnValue = instance.PromptForChoice(caption, message, choices, defaultChoice)
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 that precedes (a title) the choices.
- message
A message that describes the choice.
- choices
A collection of ChoiceDescription objects that describe each choice.
- defaultChoice
The index of the label in the Choices parameter collection. These elements are displayed to the user as the default choices. To indicate no default choice, set to -1.
Return Value
The index of the Choices parameter collection element that corresponds to the option that is selected by the user.
To provide a set of choices that allow the user to select multiple choices, implement the IHostUISupportsMultipleChoiceSelection interface.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
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