Daily Report – iPhone Version

If you are using my Daily Report script and want a nice output I have just received a cool tip from NiTRo over at http://www.hypervizor.fr

He explained how to alter the script to get it looking nice on the iPhone, check out the before and after:

Before After
before after

To achieve this all you have to do is alter one line at the end of the Get-HTMLTable function…

$HTMLTable = $HTMLTable -replace ‘<th>’, “<th width=200>”

So the function now looks like this:

Function Get-HTMLTable {
    param([array]$Content)
    $HTMLTable = $Content | ConvertTo-Html
    $HTMLTable = $HTMLTable -replace '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', ""
    $HTMLTable = $HTMLTable -replace '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">', ""
    $HTMLTable = $HTMLTable -replace '<html xmlns="http://www.w3.org/1999/xhtml">', ""
    $HTMLTable = $HTMLTable -replace '<html>', ""
    $HTMLTable = $HTMLTable -replace '<head>', ""
    $HTMLTable = $HTMLTable -replace '<title>HTML TABLE</title>', ""
    $HTMLTable = $HTMLTable -replace '</head><body>', ""
    $HTMLTable = $HTMLTable -replace '</body></html>', ""
    $HTMLTable = $HTMLTable -replace '<th>', "<th width=200>"
    Return $HTMLTable
}

Thanks very much to NiTRo for his work on this and I hope it helps out any iPhone users, now all I need is a way to make it look nicer for us Windows Mobile Users 🙂

7 thoughts on “Daily Report – iPhone Version

  1. Pingback: vCheck : l’ultime script de reporting pour vCenter - Hypervisor.fr

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.