liveBook · Manning

View

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

A view name is the identifier assigned to a formatting view within a type-specific view set.

A view is an XML-based formatting definition selected for a specific object type. Its name identifies the view within that type’s view set, while headers and displayed values control presentation rather than the underlying object. section 24.2.1 section 24.2.3

A practical custom view typically defines:

  • A unique Name for the selected type, such as DiskInfo for Toolmaking.DiskInfo. section 24.2.3
  • Table headers, widths, alignment, and property entries that shape readable output. section 24.2.3

DiskInfo

A Get-DiskInfo function emits objects with the Toolmaking.DiskInfo type name. A DiskInfo view then displays ComputerName as Host, DomainController as DC, Model, and TotalPhysicalMemory as right-aligned RAM. Friendly labels improve the table, but selecting Mandolin later fails because it is not an actual property. section 24.2.1

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 view structure, type selection, labels, widths, alignment, and property mapping, but not a formal format-file specification.
Examples
Uses native default views, System.Reflection.Assembly table XML, and a DiskInfo view for machine information.
What it assumes
Assumes PowerShell objects and properties, then develops practical XML editing for formatting definitions.
What you can do after
Build it from scratch by assigning a custom type name, editing XML table definitions, and packaging the format view with a module.
How it connects
Connects PowerShell formatting system with object properties, type names, format files, Format-* cmdlets, and custom modules.

Also explained in

Compare how 2 books explain view →

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.