PSHostUserInterface::Prompt Method (String^, String^, Collection<FieldDescription^>^)
Updated: April 27, 2016
Applies To: Windows PowerShell
When overridden in a derived class, prompts the user for input.
Assembly: System.Management.Automation (in System.Management.Automation.dll)
public: virtual Dictionary<String^, PSObject^>^ Prompt( String^ caption, String^ message, Collection<FieldDescription^>^ descriptions ) abstract
The text that precedes the prompt.
The text of the prompt.
Return ValueType: System.Collections.Generic::Dictionary<String^, PSObject^>^
A Dictionary<TKey, TValue> 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.
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.