New-ConsoleSplitter
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>]#All Parameter SetsDescription
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
- Use the available height.
- -First Object
- The left pane, or the top pane with -Vertical: widgets, text or a script block that emits them.
- -Height Int32
- Fixed height in cells.
- -Key String
- Name the ratio is remembered under on each app screen.
- -Ratio Double
- The first pane's share of the space, from 0.05 to 0.95.
- -Second Object
- The right pane, or the bottom pane with -Vertical.
- -Vertical SwitchParameter
- Stacks the panes top and bottom with a horizontal divider.
- -Weight Double
- 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.