Have you had a chance to check out the ConverTo-Html cmdlet?
NAME ConvertTo-Html SYNOPSIS Creates an HTML page that represents an object or a set of objects. SYNTAX ConvertTo-Html [-inputObject <psobject>] [[-property] <Object>] [-body <string>] [-h ead <string>] [-title <string>] [<CommonParameters>] DETAILED DESCRIPTION The ConvertTo-HTML cmdlet creates an HTML page that represents one or more objects. The cmdlet returns a complete HTML page with the input objects in an HTML table on the page. The object's properties are column headings and the property values are listed in the t able rows.
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
You'd do better to create an object for your output. That way, it's much more flexible. Read about it here: http://www.peetersonline.nl/index.php/powershell/pimp-your-output-use-objects
Below is my script that checks for snapshots. You can easily adapt it to create HTML output by piping the output $myCol to ConvertTo-HTML. See this article for more help using HTML output: http://www.microsoft.com/technet/scriptcenter/resources/pstips/jan08/pstip0104.mspx
Hope this helps.
$VC = "server.domain.ext"
Write-Host "Connecting to VC server $VC ..."
$connectingVC = Get-VIServer $VC
Write-Host "Locating all virtual servers"
$vms = Get-VM
$myCol = @()
ForEach ($vm in $vms)
Write-Progress "Searching for snapshots" "Percent complete" +-PercentComplete +(100*$i/$vms.Length)
$snapshots = Get-SnapShot -VM $vm
ForEach ($snapshot in $snapshots)
$myObj = "" | Select-Object VM, Snapshot, Created
$myObj.VM = $vm.name
$myObj.Snapshot = $snapshot.name
$myObj.Created = $snapshot.created
$myCol += $myObj
$myCol | Sort-Object VM | Format-Table -AutoSize