Hi,
As $3parCapacity is a string array, the ConvertTo-Html cmdlet only gets the Length property and converts it to HTML. You can covert $3parCapacity to some custom objects.
$htmlfile = "C:\temp\output.html"
$table=@()
$3parCapacity | Where-Object{ $_ -match ":"} | ForEach-Object {
$field,$value = $_ -split ":"
$table += [pscustomobject]@{
'field' = $field
'value' = $value}
}
$table | ConvertTo-Html | Out-File -FilePath $htmlfile
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.