liveBook · Manning

Table view

As explained in Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

A table view is a formatting configuration that displays object properties in tabular columns.

A table view is an XML formatting configuration that displays object properties in columns. A unique object type name selects the view, so the producing command must assign one rather than emit only PSCustomObject. section 24.2.3 section 24.2.1

Build a reliable table view by checking these parts:

  • Match the number of table column headers with the number of table column entries. section 24.2.3
  • Use labels and widths to make long property names readable, and right-align numeric columns when appropriate. section 24.2.3
  • Review the XML in a text editor or VS Code because self-closing column-header tags are easy to overlook. section 24.2.3

Disk information view

A DiskInfo view selects Toolmaking.DiskInfo, labels columns Host, DC, Model, and RAM, and right-aligns RAM while mapping columns to object properties.

How Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools covers it

How deep it goes
Explains XML structure, type selection, column mapping, alignment, and header-entry matching, while deferring broader view discovery.
Examples
Uses a DiskInfo view and XML listings showing property mapping, custom labels, widths, and right-aligned RAM.
What it assumes
Assumes familiarity with PowerShell objects, properties, custom type names, and basic XML elements.
What you can do after
Configure a custom PowerShell table view and diagnose broken layouts caused by mismatched columns or overlooked XML tags.
How it connects
Connects formatting views with object type names, custom objects, XML, list views, and Format commands.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools. The section links point to the parts of the book it draws on.