Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PSHostUserInterface.Prompt Method

When overridden in a derived class, prompts the user for input.

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 descriptions As Collection(Of FieldDescription)
Dim returnValue As Dictionary(Of String, PSObject)

returnValue = instance.Prompt(caption, message, descriptions)

public abstract Dictionary<string,PSObject> Prompt (
	string caption,
	string message,
	Collection<FieldDescription> descriptions
public abstract Dictionary<String,PSObject> Prompt (
	String caption, 
	String message, 
	Collection<FieldDescription> descriptions
public abstract function Prompt (
	caption : String, 
	message : String, 
	descriptions : Collection<FieldDescription>
) : Dictionary<String,PSObject>



The text that precedes the prompt.


The text of the prompt.


A Collection of FieldDescription objects that contains the user input.

Return Value

A Dictionary of types String and PSObject that contains the results of the user prompts. The keys of the dictionary are the field names from the FieldDescription objects. The dictionary values are objects that represent the values of the corresponding fields as collected from the user.

Exception typeCondition

The host can throw this exception when it cannot complete an operation.


If this method is not implemented, the host should throw a "not implemented" exception when it receives this call.


The host can throw this exception when an error occurs while a command is running.

To the extent possible, the host should return values of the type(s) identified in the FieldDescription objects. When that is not possible (for example, the type is not available to the host), the host should return the value as a string.

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


Target Platforms

© 2015 Microsoft