O'Reilly logo

Learn PowerShell Toolmaking in a Month of Lunches by Don Jones and Jeffrey Hicks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.3. Making a view

We’ll start with the following listing, where we’ve provided the basic shell for the XML file.

Listing 12.2. Basic template for an empty format file
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
    <ViewDefinitions>
    </ViewDefinitions>
</Configuration>

We’ve saved this as C:\Test.format.ps1xml. We suggest saving your view files to a short path—like C:\, or C:\Test, or something else—while you’re working on the file. You’ll be typing that path a lot, so keeping it short saves you time and effort. Note that the contents of our file are already showing good XML formatting practices: We’re indenting each nested set of tags and making sure that each tag is closed at the proper level.

For example, the outermost tag pair ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required