Powershell 为ConvertTo Html的Commandlet的结果创建多个Html表?
我有以下脚本。我希望它返回两个html表,但是,它们都返回一个大的html表。这是使用Powershell 为ConvertTo Html的Commandlet的结果创建多个Html表?,powershell,powershell-3.0,Powershell,Powershell 3.0,我有以下脚本。我希望它返回两个html表,但是,它们都返回一个大的html表。这是使用转换为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 否。converttohtml不区分不同的输入行
转换为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
否。
converttohtml
不区分不同的输入行块。如果要创建自定义HTML输出,则必须编写自己的函数/cmdlet。否。转换为HTML
不会区分不同的输入行块。如果要创建自定义HTML输出,则必须编写自己的函数/cmdlet。不是很优雅,但它可以工作:
get-process | select -first 3 | ConvertTo-Html -body (dir | select -first 3 | convertto-html -fragment) |out-file result.html
祝你好运 不是很优雅,但它可以工作:
get-process | select -first 3 | ConvertTo-Html -body (dir | select -first 3 | convertto-html -fragment) |out-file result.html
祝你好运