Skip to content
ConsoleMonster
Cmdlet

New-ConsoleMenu

Module ConsoleMonster
Inputs
None
Outputs
ConsoleMonster.Interactive.Menu

Creates a menu from items (New-ConsoleMenuItem) for Show-ConsoleMenu.

Syntax

New-ConsoleMenu [[-Content] <ScriptBlock>] [-Description <String>] [-Item <MenuItem[]>] [-Layout <Auto|Classic|Shell|Inline>] [-Subtitle <String>] [-Title] <String> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Creates a menu from items (New-ConsoleMenuItem) for Show-ConsoleMenu.

The scriptblock runs once and its New-ConsoleMenuItem output becomes the items, in order. A menu can be shown as an app (Shell: title bar with the breadcrumb, sidebar, content pane, key footer), a centred menu (Classic) or a list in the scrollback (Inline); the layout can be set here or on Show-ConsoleMenu.

Examples

Authored help example

EXAMPLE 1

New-ConsoleMenu -Title 'Value'

Parameters

-Content ScriptBlock optionalposition: 1
A scriptblock whose New-ConsoleMenuItem output becomes the items.
-Description String optional
A sentence shown above the items.
-Item MenuItem[] optional
Items created beforehand.
-Layout MenuLayout optional
The default layout for Show-ConsoleMenu: Auto, Classic, Shell or Inline.
Possible values: Auto, Classic, Shell, Inline
-Subtitle String optional
Muted text at the right of the footer (a version, an environment).
-Title String requiredposition: 0
The title (the app name for the top menu).

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.