我有一张由不同领域的工作项目组成的表格。这是表格布局:
$table = @{Expression = {$_.Fields['Id'].Value}; Label = "Id"},
@{Expression = {$_.Fields['Work Item Type'].Value}; Label = "Work Item Type"},
@{Expression = {$_.Fields['Title'].Value}; Label = "Title"},
@{Expression = {$_.Fields['State'].Value}; Label = "State"},
@{Expression = {$_.Fields['Substate'].Value}; Label = "Substate"},
@{Expression = {$_.Fields['Assigned To'].Value}; Label = "Assigned To"},
@{Expression = {$_.Fields['CreatedBy'].Value}; Label = "Developer"},
@{Expression = {$_.Fields['QA Responsible'].Value}; Label = "QA Responsible"},
@{Expression = {$_.Fields['Iteration Path'].Value}; Label = "Iteration Path"}
从这行代码$workItems | Format-Table $table | Out-String
我得到一个像这样的表:
Id Work Item Type Title State Substate Assigned To Developer QA Responsible Iteration Path
-- -------------- ----- ----- -------- ----------- --------- ----------- --------------
38479 Bug Title1000000...Resolved zzzzzzzzzzz... xxxxxxxxxxx... zzzzzzzzzzz... zzzzzzzzzzz QA\2012 August
34917 Task Title2000000...Resolved zzzzzzzzzzz... xxxxxxxxxxx WebXXX\CCCCCC
但是当我尝试将其转换为 HTML 时,我得到了不同的值。像这里的这些:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML TABLE</title>
</head><body>
<table>
<colgroup>
<col/>
</colgroup>
<tr><th>*</th></tr>
<tr><td>305</td></tr>
</table>
</body></html>
我只想用 HTML 格式化表格并通过电子邮件发送。我可以得到任何帮助吗?