Skip to content
ConsoleMonster
Cmdlet

Read-ConsoleForm

Module ConsoleMonster
Inputs
ConsoleMonster.Interactive.Form
Outputs
System.Management.Automation.PSObject ConsoleMonster.Interactive.FormResult

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>]
#
Parameter set: All Parameter Sets

Description

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

Authored help example

EXAMPLE 1

Read-ConsoleForm -Form 'Value'

Parameters

-AppName String optional
The app name presets and remembered choices are stored under.
-AsPlainText SwitchParameter optional
Returns secrets as plain strings.
-Form Form requiredposition: 0pipeline: True (ByValue)
The form from New-ConsoleForm.
-Inline SwitchParameter optional
Draws the form in the scrollback instead of the alternate screen.
-Mode InteractionMode optional
Forces how to ask: Rich, Line, Accessible or None.
Possible values: Rich, Line, Accessible
-PassThru SwitchParameter optional
Returns the full result (Submitted, Values, CommandLine) instead of the answers.
-Preset String optional
A saved preset to apply first.
-RememberLastChoices SwitchParameter optionalaliases: Remember
Remembers the submitted answers and offers them next time (needs -AppName).
-StorageRoot String optional
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.