Chapter 14. Working with HTML and XML data
This chapter covers
- Working with HTML
- Creating HTML output
- Persisting data with XML
- Working with XML files
PowerShell includes some great capabilities for working with two common forms of structured data: HTML and XML. Why is this important? Because HTML is a great way to produce professional-looking reports and you can use XML in so many places within your environment. If you use PowerShell, the help, format, and type files are XML. The new “cmdlet over objects” functionality in PowerShell v3 is based on XML. The HTML- and XML-related functionality hasn’t had any major changes in PowerShell v3. We’ll cover the various capabilities and provide some concise examples of how you might want to use them.
HTML—the Hypertext Markup Language—is a similar-to-XML language used to construct the content for web pages. Like XML, HTML documents consist of sets of nested tags, which form a document hierarchy:
A full discussion of HTML and all its many features is beyond the scope of this book, but you can find some excellent tutorials at www.w3schools.com/html/ if you want to learn more. PowerShell v3 introduces unique new ways to work with HTML, which we’ll cover in this chapter.