concept html in category powershell

appears as: HTML, HTML, The HTML
Learn PowerShell in a Month of Lunches MEAP V09 epub - Plunk, Leonhardt, Jones & Hicks

This is an excerpt from Manning's book Learn PowerShell in a Month of Lunches MEAP V09 epub - Plunk, Leonhardt, Jones & Hicks.

  • Can you find any cmdlets capable of converting other cmdlets’ output into HTML?
  • In the PowerShell world, the verb Export implies that you’re taking data, converting it to some other format, and saving that other format in some kind of storage, such as a file. The verb ConvertTo implies only a portion of that process: the conversion to a different format, but not saving it into a file. When you ran the preceding command, you got a screen full of HTML, which probably wasn’t what you wanted. Stop for a second: Can you think of how you’d get that HTML into a text file on disk?

    PowerShell in Depth, Second Edition

    This is an excerpt from Manning's book PowerShell in Depth, Second Edition.

    Figure 7.2. Viewing converted-to-HTML data in Internet Explorer

    Now for a quick look at HTML. The only cmdlet here is ConvertTo-HTML; for some reason, there’s no Export-HTML, so you’ll generally have to redirect the output to a file on your own. There’s also no Import or ConvertFrom option here; it’s a one-way trip to HTML. As with the CSV format, make sure you’re only converting simple property values. No nested objects. Here’s the example, and figure 7.2 shows the results.

    Figure 7.2. Viewing converted-to-HTML data in Internet Explorer

    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 “cmdlet over objects” functionality introduced in PowerShell v3 is based on XML. The HTML- and XML-related functionality hasn’t had any major changes in PowerShell v4. We’ll cover the various capabilities and provide some concise examples of how you might want to use them.

    Listing 33.4. An HTML inventory report script
    PowerShell in Practice

    This is an excerpt from Manning's book PowerShell in Practice.

    PowerShell Plus is a development environment for PowerShell (as well as text, HTML, XML, VB.NET, and C) and provides access to an interactive shell by hosting PowerShell as seen in figure 4.4. IntelliSense-like support is available in the shell and when using the editor.

    Figure 7.1. Presenting configuration information via HTML

    The second stage of our process is to convert the data into HTML that we can display in our web pages, as in listing 13.23. We can use the parameters of ConvertToHtml to select object properties, to specify a table or list format, to specify the HTML page title, to add text before and after the object, and to return only the table or list fragment, instead of a strict DTD page.

    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