New-ImageTableBlock
Creates a visual table block from PowerShell objects.
Syntax
New-ImageTableBlock [-Align <IDictionary>] [-Dense] [-Header <String[]>] [-Height <Int32>] [-InputObject] <PSObject[]> [-NoHeader] [-NoRowStriping] [[-Property] <Object[]>] [-StatusColumn <String>] [-Subtitle <String>] [-Theme <ChartTheme>] [-Title <String>] [-Width <Int32>] [<CommonParameters>]#All Parameter SetsDescription
Pipe objects in and choose columns with -Property, the same way as Select-Object or Format-Table. Property accepts property names and calculated property hashtables with Name (or Label), Expression, FormatString, Alignment, and Width keys.
Rows can be PowerShell objects, hashtables, or arrays of values in column order. Without -Property, the columns come from the first row.
Examples
Build a table from pipeline objects
Get-Service | Select-Object -First 5 | New-ImageTableBlock -Property Name, Status -StatusColumn Status -Title ServicesCreates one table block with a Name and a Status column. Missing properties produce empty cells.
Format and align columns with calculated properties
$services | New-ImageTableBlock -Title Services -StatusColumn Status -Width 616 -Height 270 -Property Name, Status,
@{ Name = 'Requests'; Expression = { [int] $_.Requests }; FormatString = 'N0'; Alignment = 'Right' },
@{ Name = 'P95'; Expression = { "$($_.P95) ms" }; Alignment = 'Right' }Formats the request count with thousands separators, appends a unit to latency, and sizes the block for a dashboard grid.
Supply rows explicitly
New-ImageTableBlock -Title Services -Column Name, Status -Row @{ Name = 'API'; Status = 'Healthy' }, @{ Name = 'Database'; Status = 'Warning' } -Dense-Column and -Row remain available as aliases of -Property and -InputObject.
Parameters
- -Align IDictionary
- Column alignment keyed by property or displayed header. Values are Left, Center, or Right.
- -Dense SwitchParameter
- Use compact row spacing.
- -Header String[]
- Displayed column names. Defaults to the property names.
- -Height Int32
- Block height in pixels. The width keeps its default unless -Width is also supplied.
- -InputObject PSObject[]
- Rows can be objects, hashtables, or arrays of values in column order.
- -NoHeader SwitchParameter
- Hide the table header.
- -NoRowStriping SwitchParameter
- Disable alternating row surfaces.
- -Property Object[]
- Calculated properties accept Name (or Label), Expression (a property name or a script block using $_), FormatString, Alignment (Left, Center, Right), and Width. When omitted, the columns are the properties of the first row.
- -StatusColumn String
- Column, by property or displayed header, that contains semantic status values such as Healthy, Warning, or Failed.
- -Subtitle String
- Optional block subtitle.
- -Theme ChartTheme
- ChartForgeX theme.
- Possible values:
Default,Dark,Light,Colorblind,Aurora,Editorial,Candy,PeopleInfographic,Terminal,TransparentOverlayDark,Minimal,DashboardLight,SaasDashboardLight,RestaurantDashboardLight - -Title String
- Optional block title.
- -Width Int32
- Block width in pixels. The height keeps its default unless -Height is also supplied.
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.