Skip to content
ConsoleMonster
Cmdlet

New-ConsoleSplitter

Module
ConsoleMonster
Outputs
ConsoleMonster.Layout.IWidget

Creates two panes with a divider that the mouse and keyboard can move.

Syntax

New-ConsoleSplitter
[-Fill]
[[-First] <Object>]
[-Height <Int32>]
[-Key <String>]
[-Ratio <Double>]
[[-Second] <Object>]
[-Vertical]
[-Weight <Double>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

The panes sit side by side, or top and bottom with -Vertical. Dragging the divider resizes them. Ctrl+Shift+Left/Right (Ctrl+Shift+Up/Down when vertical) also resizes when the focused input and configured keys leave those chords free; text editing and existing bindings take precedence. Inside Show-ConsoleApp screens, a splitter with -Key keeps its ratio for each screen, also when a binding rebuilds it.

Examples

Example 1

Show-ConsoleApp -Content {
    New-ConsoleSplitter -Key Panes -Ratio 0.35 -Fill -First {
        New-ConsoleSelect -Key Server -Choices 'web-01', 'web-02', 'db-01'
    } -Second {
        New-ConsoleBinding -Content { param($State) "Details for $($State.Server)" }
    }
}

Show a list beside its details and let the reader widen either side.

Parameters

-Fill SwitchParameter optional
Use the available height.
-First Object optionalposition: 0
The left pane, or the top pane with -Vertical: widgets, text or a script block that emits them.
-Height Int32 optional
Fixed height in cells.
-Key String optional
Name the ratio is remembered under on each app screen.
-Ratio Double optional
The first pane's share of the space, from 0.05 to 0.95.
-Second Object optionalposition: 1
The right pane, or the bottom pane with -Vertical.
-Vertical SwitchParameter optional
Stacks the panes top and bottom with a horizontal divider.
-Weight Double optional
Share of the parent layout.

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.