Generating HTML reports

CSV files are nice, but HTML files are more impressive. This section will show you how to create nice looking HTML files from your reports. PowerShell gives you the ConvertTo-Html cmdlet to do this. The syntax of this cmdlet is as follows:

ConvertTo-Html [[-Property] <Object[]>] [[-Head] <String[]>] [[-Title] <String>] [[-Body] <String[]>] [-As <String>] [-CssUri <Uri>] [-InputObject <PSObject>] [-PostContent <String[]>] [-PreContent <String[]>] [<CommonParameters>]

ConvertTo-Html [[-Property] <Object[]>] [-As <String>] [-Fragment] [-InputObject <PSObject>] [-PostContent <String[]>] [-PreContent <String[]>] [<CommonParameters>]

There are no required parameters. The first parameter set creates an entire HTML page. The second ...

Get Learning PowerCLI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.