## ## Author: Vivek Sharma (http://www.viveksharma.com) ## Description: Out-Html, turns any object in Monad / PowerShell into a pretty html page. ## ## Usage: | out-html ## Example: get-mailbox vivek | out-html ## ## @' '@ "

Output Generated by $([System.Environment]::UserName) at: " + $(get-date).ToString() + " on machine $(hostname)

" $holder = @{} $typelist = @() foreach ($i in $input) { $props = $i | get-member -membertype *prop* $type = $i.GetType().FullName $propsNames = @() foreach ( $prop in $props ) { $script:propsNames += $prop.Name } if(! $holder.ContainsKey("$type") ) { $typelist += $type $holder.$type += "`n" foreach ( $p in $script:propsNames ) { $holder.$type += '`t

' + $p + "

`n" } $holder.$type += "`n" } $holder.$type += "`n" foreach ( $p in $script:propsNames ) { $holder.$type += '`t

' + $i.$p + "

`n" } $holder.$type += "`n" $count++ } foreach($key in $typelist) { "

Command line: $($myinvocation.Line)


" '' $holder.$key '

' } '

`n'