en-US/pwsh-prompt.dll-Help.xml
|
<?xml version="1.0" encoding="utf-8"?> <helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Prompt-Choice</command:name> <command:verb>Prompt</command:verb> <command:noun>Choice</command:noun> <maml:description> <maml:para>Prompts the user to select one or more items from an interactive picker.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Choices are rendered as a navigable list in the terminal. The user selects via arrow keys, digit keys (1-based page-relative), or hotkeys defined on individual items. When `-Multiple` is set, the user may toggle multiple selections before confirming with Enter. Output: An `int[]` of 0-based indices into the original `-Choices` array, or `$null` when the user cancels with Escape or Ctrl-C. Terminating errors: - `ParameterDefinitionError` — a parameter was defined incorrectly by the caller (mixed non-hashtable element types in `-Choices`, missing `Value` key in a hashtable choice, unknown key in a hashtable choice, `-Message` or `-Title` is not a string or hashtable, `-Message` text exceeds 228 characters, `-Default` index is out of range, unknown key in `-AlternateBuffer`). These represent developer mistakes and are thrown during parameter validation in `BeginProcessing`.</maml:para> <maml:para>- `NonInteractiveTerminal` — the cmdlet requires an interactive terminal (a real console with `Console.KeyAvailable` support) but none is attached. Thrown during `ProcessRecord`. Non-terminating errors: None. All errors are terminating. Color format: See `AnsiColor` for the color tuple format used by all `ForegroundColor`/`fg` and `BackgroundColor`/`bg` keys. Style format: See `TextStyle` for the valid text decoration flags. Label format: See `Label` for the hashtable format used by `-Message`, `-Title`, and nested item/pagination configs. Buffer configuration: See `BufferConfig`, `BorderConfig`, `ItemConfig`, and `PaginationConfig` for the `-AlternateBuffer` hashtable schema.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Prompt-Choice</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Choices</maml:name> <maml:description> <maml:para>Array of choices to present. Must not be empty</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Message</maml:name> <maml:description> <maml:para>The prompt message. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AlternateBuffer</maml:name> <maml:description> <maml:para>Alternate buffer appearance. @{} for defaults. See `about_BufferConfig`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CycleMode</maml:name> <maml:description> <maml:para>Arrow-key boundary behavior: Next, Cycle, or Stop</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Next</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cycle</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stop</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">PwshPrompt.Enums.CycleMode</command:parameterValue> <dev:type> <maml:name>PwshPrompt.Enums.CycleMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Default</maml:name> <maml:description> <maml:para>0-based index of the initially selected choice. Must be less than the number of choices.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Multiple</maml:name> <maml:description> <maml:para>Allow multi-select. Users toggle choices with Space and confirm with Enter.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Title</maml:name> <maml:description> <maml:para>Title displayed above the prompt. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AlternateBuffer</maml:name> <maml:description> <maml:para>Alternate buffer appearance. @{} for defaults. See `about_BufferConfig`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Choices</maml:name> <maml:description> <maml:para>Array of choices to present. Must not be empty</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CycleMode</maml:name> <maml:description> <maml:para>Arrow-key boundary behavior: Next, Cycle, or Stop</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PwshPrompt.Enums.CycleMode</command:parameterValue> <dev:type> <maml:name>PwshPrompt.Enums.CycleMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Default</maml:name> <maml:description> <maml:para>0-based index of the initially selected choice. Must be less than the number of choices.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Message</maml:name> <maml:description> <maml:para>The prompt message. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Multiple</maml:name> <maml:description> <maml:para>Allow multi-select. Users toggle choices with Space and confirm with Enter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Title</maml:name> <maml:description> <maml:para>Title displayed above the prompt. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Int32[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Prompt-Choice @("Red", "Green", "Blue") "Pick a color"</dev:code> <dev:remarks> <maml:para>Presents a single-select picker. Returns the selected index (e.g. `@(1)` for "Green").</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>$items = @( @{ Value = "dev"; Description = "Development"; HotKey = "d" }, @{ Value = "staging"; HotKey = "s" }, @{ Value = "prod"; Description = "Production"; HotKey = "p" } ) Prompt-Choice $items "Deploy to:" -Multiple</dev:code> <dev:remarks> <maml:para>Presents a multi-select picker with hotkeys and descriptions.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>$dbs = @( @{ Value = "Redis"; HelpMessage = "Fast in-memory cache"; Description = "In-memory key-value store.`nSupports pub/sub, streams, and sorted sets." }, @{ Value = "PostgreSQL"; HelpMessage = "Relational DB"; Description = "Advanced open-source relational database.`nFull SQL compliance with JSONB and range types." }, @{ Value = "MongoDB"; HelpMessage = "Document store" } ) Prompt-Choice $dbs "Pick a database"</dev:code> <dev:remarks> <maml:para>Items with HelpMessage show it dimmed inline (or in the status bar if too long). Items with Description show a first-line preview; press F1 to view the full description.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 4 --------------------------</maml:title> <dev:code>Prompt-Choice @("A","B","C") "Choose" -Default 2 -CycleMode Cycle</dev:code> <dev:remarks> <maml:para>Pre-selects index 2 ("C") and wraps navigation within the current page.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 5 --------------------------</maml:title> <dev:code>Prompt-Choice @("One","Two","Three") "Select" -AlternateBuffer @{}</dev:code> <dev:remarks> <maml:para>Renders the picker in the alternate screen buffer with default styling.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 6 --------------------------</maml:title> <dev:code>Prompt-Choice @("Alpha","Beta","Gamma") "Pick one" -AlternateBuffer @{ fg = @("White", "255;255;255") bg = @("DarkBlue", "0;0;139") Border = @{ hs = "═"; vs = "║" tl = "╔"; tr = "╗" bl = "╚"; br = "╝" Color = @("Cyan", "0;255;255") } }</dev:code> <dev:remarks> <maml:para>Renders in the alternate screen buffer with custom colors and double-line box-drawing border.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/cmdlets/Prompt-Choice</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Label</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_Label</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Color</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_Color</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_TextStyle</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_TextStyle</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_BufferConfig</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_BufferConfig</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_BorderConfig</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_BorderConfig</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_ItemConfig</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_ItemConfig</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PaginationConfig</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_PaginationConfig</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Prompt-Input</command:name> <command:verb>Prompt</command:verb> <command:noun>Input</command:noun> <maml:description> <maml:para>Prompts the user for typed input with optional validation, type coercion, and retry logic.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Retry behavior: By default the cmdlet re-prompts indefinitely until valid input is received. To limit retries, use `-AttemptsAllotment` (alias `-Attempts`) to cap the number of attempts, or use `-ErrorAction Stop` to terminate on the first invalid input. When the attempt limit is reached a terminating `AttemptsExhausted` error is thrown. ErrorAction scope: The `-ErrorAction` preference only affects non-terminating errors emitted during the retry loop (ErrorIds: `InputRequired`, `InvalidInputType`). All other errors are terminating and cannot be suppressed with `-ErrorAction`. Terminating errors: - `ParameterDefinitionError` — a parameter was defined incorrectly by the caller (invalid Culture name, Message/Title is not a string or hashtable, Validation scriptblock returned an unexpected shape or threw an unexpected exception). These represent developer mistakes.</maml:para> <maml:para>- `AttemptsExhausted` — the user exceeded the allowed number of input attempts. Non-terminating errors (retry loop): - `InputRequired` — empty input when `-AllowNull` is not set and no `-Default` is provided.</maml:para> <maml:para>- `InvalidInputType` — input could not be converted to `-ExpectedType` or failed `-Validation`.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Prompt-Input</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Message</maml:name> <maml:description> <maml:para>The prompt message. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowNull</maml:name> <maml:description> <maml:para>Permit empty input. The cmdlet outputs $null when the user presses Enter.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Attempts"> <maml:name>AttemptsAllotment</maml:name> <maml:description> <maml:para>Maximum number of attempts. Omit for unlimited retries.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Culture</maml:name> <maml:description> <maml:para>Culture name (e.g. 'en-US') for parsing numeric and date/time types. Defaults to current culture.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Default</maml:name> <maml:description> <maml:para>Fallback value used when the user presses Enter without typing anything.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ExpectedType</maml:name> <maml:description> <maml:para>Target type for input coercion. Case-sensitive. Defaults to 'string'.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">bool</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">byte</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">char</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">string</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">short</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ushort</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">int</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">integer</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">uint</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">long</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ulong</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">float</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">double</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">decimal</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">directory</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">file</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">regex</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">guid</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">version</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">uri</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">date</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">datetime</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">time</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Title</maml:name> <maml:description> <maml:para>Title displayed above the prompt. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Validation</maml:name> <maml:description> <maml:para>ScriptBlock invoked with the coerced value as $_ and $args[0]. Must return a single tuple @($ok, $message) where $ok is [bool] and $message is [string] or $null.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowNull</maml:name> <maml:description> <maml:para>Permit empty input. The cmdlet outputs $null when the user presses Enter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Attempts"> <maml:name>AttemptsAllotment</maml:name> <maml:description> <maml:para>Maximum number of attempts. Omit for unlimited retries.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Culture</maml:name> <maml:description> <maml:para>Culture name (e.g. 'en-US') for parsing numeric and date/time types. Defaults to current culture.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Default</maml:name> <maml:description> <maml:para>Fallback value used when the user presses Enter without typing anything.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ExpectedType</maml:name> <maml:description> <maml:para>Target type for input coercion. Case-sensitive. Defaults to 'string'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Message</maml:name> <maml:description> <maml:para>The prompt message. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Title</maml:name> <maml:description> <maml:para>Title displayed above the prompt. Accepts a Label configuration: a string or hashtable. See `about_Label`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Validation</maml:name> <maml:description> <maml:para>ScriptBlock invoked with the coerced value as $_ and $args[0]. Must return a single tuple @($ok, $message) where $ok is [bool] and $message is [string] or $null.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Boolean</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Byte</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Char</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Int16</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.UInt16</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Int32</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.UInt32</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Int64</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Single</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Double</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Decimal</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.IO.DirectoryInfo</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Text.RegularExpressions.Regex</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Guid</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Version</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Uri</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.DateOnly</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.DateTime</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.TimeOnly</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Prompt-Input "Enter your name"</dev:code> <dev:remarks> <maml:para>Prompts indefinitely until a non-empty string is entered.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>Prompt-Input "Pick a number" -ExpectedType int -AttemptsAllotment 3</dev:code> <dev:remarks> <maml:para>Allows at most 3 attempts to enter a valid integer before throwing a terminating error.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>Prompt-Input "Config dir" -ExpectedType directory -Default "~/.config"</dev:code> <dev:remarks> <maml:para>Prompts for an existing directory with tab completion; defaults to ~/.config on empty input.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/cmdlets/Prompt-Input</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Label</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_Label</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Color</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_Color</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_TextStyle</maml:linkText> <maml:uri>https://github.com/soulshined/pwsh-prompt/wiki/about_TextStyle</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |