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.

14.1. Working with HTML

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:

<Body>
  <H1>This is a heading</H1>
  <p>This is some text</p>
</Body>

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.

14.1.1. Retrieving an HTML page

14.2. Working with XML

 
 
 
 

14.3. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest