When using ConvertTo-HTML with no input object and only -body and -head tags, the output contains a trailing set of empty <table> tags. This causes some minor graphical glitching when emailing the contents via Outlook. Apart from dumping the output to a string and manually searching/replacing the empty tags, is there an option that will suppress this spurious tag?
$a = Get-Process |Convertto-html -fragment
$b = Get-service |Convertto-html -fragment
convertto-html -body “$a $b”
This comes up a lot for me as my usual flow is to build up a report in pieces and then to combine the report segments with CSS via a final ConvertTo-HTML with -body and -head tags for style application.