Skip to content
ConsoleMonster
Cmdlet

New-ConsoleForm

Module ConsoleMonster
Inputs
None
Outputs
ConsoleMonster.Interactive.Form

Creates a form or wizard from fields (New-ConsoleField) for Read-ConsoleForm or a menu item.

Syntax

New-ConsoleForm [-Command <String>] [-CommandStyle <PowerShell|Posix|Windows>] [[-Content] <ScriptBlock>] [-Description <String>] [-Field <Field[]>] [-NoReview] [-StorageKey <String>] [-SubmitText <String>] [-Title] <String> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Creates a form or wizard from fields (New-ConsoleField) for Read-ConsoleForm or a menu item.

The scriptblock's New-ConsoleField output becomes the fields. Fields with -Page are grouped into pages in the order the page names first appear, which turns the form into a wizard with a progress strip. Unless -NoReview is given, a review page follows: every answer, the equivalent command line (from -Command and each field's -Parameter), Run, Copy command, Save preset and Back.

Examples

Authored help example

EXAMPLE 1

New-ConsoleForm -Title 'Value'

Parameters

-Command String optional
The command the equivalent command line starts with.
-CommandStyle CommandStyle optional
How the equivalent command line is written: PowerShell (-Name value), Posix (--name value) or Windows (/name:value).
Possible values: PowerShell, Posix, Windows
-Content ScriptBlock optionalposition: 1
A scriptblock whose New-ConsoleField output becomes the fields.
-Description String optional
A sentence under the title.
-Field Field[] optional
Fields created beforehand.
-NoReview SwitchParameter optional
Leaves out the review page.
-StorageKey String optional
The key presets and remembered choices are stored under (default: the title).
-SubmitText String optional
The caption of the submit button (default Run).
-Title String requiredposition: 0
The title.

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.