liveBook · Manning

Chapter 8: Objects: Data by another name

What you will learn in chapter 8 of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

The introduction emphasizes that objects are central to PowerShell and directs readers to a starting section based on their programming experience.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction emphasizes that objects are central to PowerShell and directs readers to a starting section based on their programming experience.

8.1 What are objects?

This section introduces PowerShell objects through an in-memory table analogy and explains why command output shows fewer properties than are available.

Key terms: object, property, method, collection, Get-Process, properties, pipeline, ConvertTo-Html

8.2 Understanding why PowerShell uses objects

The section explains why PowerShell represents command output as objects rather than plain text, emphasizing less fragile data handling and a historical fit with Windows.

Key terms: objects, column name, in-memory table, Get-Process, grep, parsing text, ProcessName, object-oriented, Windows

8.3 Discovering objects: Get-Member

This section shows how to inspect the members and type of PowerShell objects, including information not shown in default output.

Key terms: Get-Member, gm, members, properties, methods, pipeline, collection of objects, TypeName, type of object

8.4 Using object attributes, or properties

This section explains what object properties contain and why PowerShell shows some properties that are absent from .NET documentation.

Key terms: property, value, read-only, Get-Member, extensible type system, ETS, AliasProperty, ScriptProperty, NoteProperty

8.5 Using object actions, or methods

The section introduces object methods as actions but recommends using cmdlets for the tasks covered in this book.

Key terms: methods, Kill method, process object, cmdlets, .NET programming

8.6 Sorting objects

This section shows how to reorder PowerShell objects by one or more properties with Sort-Object.

Key terms: Sort-Object, -Property, -Descending, ascending order, comma-separated list, process ID

8.7 Selecting the properties you want

This section shows how Select-Object chooses which properties to show, can keep the first or last objects, and differs from criteria-based filtering.

Key terms: Select-Object, -Property, properties, positional, -First, -Last, Where-Object

8.8 Objects until the end

This section shows how object types can change along a PowerShell pipeline and how the objects left at the end determine the output display.

Key terms: pipeline, objects, Sort-Object, Out-File, Select-Object, PSObject, properties, process object, gm, Get-Member

8.9 Common points of confusion

This section highlights common mistakes when inspecting objects and reading PowerShell pipelines.

Key terms: help files, properties, gm, Get-Member, pipeline, objects, Stop-Process, pipeline character

8.10 Lab

8.11 Lab answers

Where this is used later

Concepts explained in this chapter

← Chapter 7: Adding commands Chapter 9: A practical interlude →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.