Chapter 8. Formatting—and why it’s done on the right

 

Let’s quickly review: you know that PowerShell cmdlets produce objects, and that those objects often contain more properties than PowerShell shows by default. You know how to use Gm to get a list of all of an object’s properties, and you know how to use Select-Object to specify the properties you want to see. Up to now, you’ve relied on PowerShell’s default configuration and rules to determine how the final output will appear on the screen (or in a file, or in hardcopy form). In this chapter, you’ll learn to override those defaults and create your own formatting for your commands’ output.

8.1. Formatting: making what you see prettier

I don’t want to give you the impression that PowerShell is a full-fledged management reporting tool, because it isn’t. But PowerShell has good capabilities for collecting information about computers, and, with the right output, you can certainly produce reports using that information. The trick, of course, is getting the right output, and that’s what formatting is all about.

8.2. About the default formatting

8.3. Formatting tables

8.4. Formatting lists

8.5. Formatting wide

8.6. Custom columns and list entries

8.7. Going out: to a file, a printer, or the host

8.8. Another out: GridViews

8.9. Common points of confusion

8.10. Lab

8.11. Ideas for on your own