Read-ConsoleForm
Shows a form or wizard and returns the answers.
Syntax
Read-ConsoleForm [-AppName <String>] [-AsPlainText] [-Form] <Form> [-Inline] [-Mode <Rich|Line|Accessible>] [-PassThru] [-Preset <String>] [-RememberLastChoices] [-StorageRoot <String>] [<CommonParameters>]#All Parameter SetsDescription
Shows a form or wizard and returns the answers.
The form opens on the alternate screen (or in the scrollback with -Inline). Fields are edited in place; choice fields open a filterable list; dependent options load with a spinner. The review page shows every answer and the equivalent command (copy it, save the answers as a named preset, or run). The answers come back as one object with a property per visible field (secrets as SecureString unless -AsPlainText); -PassThru returns the full result (Submitted, Values, CommandLine) instead. Cancelling returns nothing. -AppName stores presets, and with -RememberLastChoices the last answers, per user under %APPDATA%\ConsoleMonster\<app>. In remoting and the ISE the fields are asked one by one; without a user the defaults are used, or an error names the first field that needs a value.
Examples
EXAMPLE 1
Read-ConsoleForm -Form 'Value'Parameters
- -AppName String
- The app name presets and remembered choices are stored under.
- -AsPlainText SwitchParameter
- Returns secrets as plain strings.
- -Form Form
- The form from New-ConsoleForm.
- -Inline SwitchParameter
- Draws the form in the scrollback instead of the alternate screen.
- -Mode InteractionMode
- Forces how to ask: Rich, Line, Accessible or None.
- Possible values:
Rich,Line,Accessible - -PassThru SwitchParameter
- Returns the full result (Submitted, Values, CommandLine) instead of the answers.
- -Preset String
- A saved preset to apply first.
- -RememberLastChoices SwitchParameter
- Remembers the submitted answers and offers them next time (needs -AppName).
- -StorageRoot String
- The folder that holds the app's storage folder (default: per user).
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.