Megosztás a következőn keresztül:


PSHostUserInterface.Prompt Method

Definition

Constructs a 'dialog' where the user is presented with a number of fields for which to supply values.

public:
 abstract System::Collections::Generic::Dictionary<System::String ^, System::Management::Automation::PSObject ^> ^ Prompt(System::String ^ caption, System::String ^ message, System::Collections::ObjectModel::Collection<System::Management::Automation::Host::FieldDescription ^> ^ descriptions);
public abstract System.Collections.Generic.Dictionary<string,System.Management.Automation.PSObject> Prompt (string caption, string message, System.Collections.ObjectModel.Collection<System.Management.Automation.Host.FieldDescription> descriptions);
abstract member Prompt : string * string * System.Collections.ObjectModel.Collection<System.Management.Automation.Host.FieldDescription> -> System.Collections.Generic.Dictionary<string, System.Management.Automation.PSObject>
Public MustOverride Function Prompt (caption As String, message As String, descriptions As Collection(Of FieldDescription)) As Dictionary(Of String, PSObject)

Parameters

caption
String

Caption to precede or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)"

message
String

A text description of the set of fields to be prompt.

descriptions
Collection<FieldDescription>

Array of FieldDescriptions that contain information about each field to be prompted for.

Returns

A Dictionary object with results of prompting. The keys are the field names from the FieldDescriptions, the values are objects representing the values of the corresponding fields as collected from the user. To the extent possible, the host should return values of the type(s) identified in the FieldDescription. When that is not possible (for example, the type is not available to the host), the host should return the value as a string.

Applies to

See also