More about the out-html | out-ie functionality

by Bharat Suneja

Just heard back from Vivek – apparently this functionality is actually provided by a couple of commandlets that he blogged about earlier – you can read it here.

Save the following code in a file called out-ie.msh in \Program Files\Microsoft Command Shell\v1.0 folder:

$ie = new-object -com InternetExplorer.Application
$ie.navigate(“about:blank”)
while ($ie.busy) { sleep 1 }
$ie.visible = $true
$ie.document.write(“$input”)
# if above line doesn’t work on your system, uncomment line below
# $ie.document.IHTMLDocument2_write(“$input”)
$ie

Copy the code for out-html from this page on Vivek’s blog and save it as out-html.ps1 in the same location.

Now try piping output to html and display it in IE – for instance:

get-storagegroup | out-html | out-ie

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: