New-ConsoleForm
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>]#All Parameter SetsDescription
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
EXAMPLE 1
New-ConsoleForm -Title 'Value'Parameters
- -Command String
- The command the equivalent command line starts with.
- -CommandStyle CommandStyle
- How the equivalent command line is written: PowerShell (-Name value), Posix (--name value) or Windows (/name:value).
- Possible values:
PowerShell,Posix,Windows - -Content ScriptBlock
- A scriptblock whose New-ConsoleField output becomes the fields.
- -Description String
- A sentence under the title.
- -Field Field[]
- Fields created beforehand.
- -NoReview SwitchParameter
- Leaves out the review page.
- -StorageKey String
- The key presets and remembered choices are stored under (default: the title).
- -SubmitText String
- The caption of the submit button (default Run).
- -Title String
- 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.