0

I have the following scripts. I wish it returns two html tables, however, both of them return a big html table. Is it a way to create multiple tables using ConvertTo-Html?

@(dir | select -First 3; Get-Process | select -First 3) | ConvertTo-Html

@{dir = dir | select -First 3; ps = Get-Process | select -First 3} | 
    ConvertTo-Html
4

2 に答える 2

3

あまりエレガントではありませんが、機能します:

get-process | select -first 3 | ConvertTo-Html -body (dir | select -first 3 | convertto-html -fragment) |out-file result.html

幸運を!

于 2013-05-14T23:58:33.620 に答える