【发布时间】:2014-05-07 01:04:18
【问题描述】:
我正在尝试使用以下代码将 powershell 结果输出到 html 文件中:
$a = "<style>"
$a = $a + "BODY{background-color:white;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:white}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:white}"
$a = $a + "</style>"
Get-item c:\work | select-object Name,Lastwritetime,@{label="Size" ; expression={[math]::round(((Get-childitem -force "c:\work" -recurse | measure-object length -sum).sum/1Gb),1)}}
get-childitem .....| Convertto-html -head $a | Out-File -append C:\temp\backup.htm
....
....
html文件的结果如下:
所以我的问题是:
如何在顶部只有一个Name LastTime Size 行以及如何固定表单的长度?
【问题讨论】:
标签: html powershell powershell-2.0 powershell-3.0