Skip to content
ConsoleMonster
Cmdlet

New-ConsoleRows

Module
ConsoleMonster
Inputs
System.Object
Outputs
ConsoleMonster.Layout.IWidget

Stacks console widgets vertically.

Syntax

New-ConsoleRows
[[-Content] <Object>]
[-Fill]
[-Gap <Int32>]
[-Weight <Double>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Children emitted by the scriptblock are placed top to bottom. In a live dashboard, children created with -Fill or -Weight share the remaining height.

Examples

Example 1

$rowsOptions = @{
    Gap = 1
    Content = { New-ConsoleRule -Title 'Summary'; New-ConsoleKeyValue -InputObject @{ Total = 12 } }
}
New-ConsoleRows @rowsOptions

Two widgets stacked with a blank row between them

Example 2

$rowsOptions = @{
    Gap = 1
    Content = {
        $textOptions2 = @{
            Text = @('Inventory')
            Decoration = @('Bold')
        }
        New-ConsoleText @textOptions2
        $textOptions = @{
            Text = @('web01 and web02 are online')
            Role = 'Pass'
        }
        New-ConsoleText @textOptions
    }
}
New-ConsoleRows @rowsOptions | Show-Console

Stack an inventory heading and result

Example 3

Get-ConsoleDemo -Slug 'live-filter' | Select-Object -ExpandProperty Source
Get-ConsoleDemo -Slug 'task-menu' | Select-Object -ExpandProperty Source

Read any of these gallery scripts to see New-ConsoleRows in a complete example. Each lookup returns the script's source. Use the same slug with Show-ConsoleDemo to run it.

Parameters

-Content Object optionalposition: 0pipeline: True (ByValue)
Scriptblock that emits the child widgets.
-Fill SwitchParameter optional
Take the remaining height of a live dashboard.
-Gap Int32 optional
Blank rows between children.
-Weight Double optional
Share of the space this group takes inside its parent.

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.