Skip to content

Add-SpectreTableRow

Description

Adds a row to a Spectre Console table. The number of columns in the row must match the number of columns in the table.


Examples

Example 1 # This example demonstrates how to add a row to an existing Spectre Console table.

Terminal window
$data = @(
[pscustomobject]@{Name="John"; Age=25; City="New York"},
[pscustomobject]@{Name="Jane"; Age=30; City="Los Angeles"}
)
$table = Format-SpectreTable -Data $data
$table | Out-SpectreHost
$table = Add-SpectreTableRow -Table $table -Columns "Shaun", 99, "Wellington"
$table | Out-SpectreHost

Parameters

Table

The table to which the row will be added.

TypeRequiredPositionPipelineInput
[Table]true1false

Columns

An array of renderable items containing the data to be displayed in the columns of this row.

TypeRequiredPositionPipelineInput
[Array]false2true (ByValue)

Syntax

Terminal window
Add-SpectreTableRow [-Table] <Table> [[-Columns] <Array>] [<CommonParameters>]