Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 258290

Re: issue with HTML output

$
0
0

Since the script already produces HTML, there is no need to do the ConvertTo-Html.

The following are in fact some HTML remarks:

 

  • The data needs to go with the <td> tag, not <th> which is only for the header of the table
  • And you have to indicate what the rows are with <tr>

 

Something like this for example

 

 

$VMInfo= @()

$VMInfo+="<table>"

$VMInfo+="<tr><th><center>VM Name</th><th><center>IP Address</th></tr>"

 

Get-VM-Namedb1-PipelineVariablevm|

ForEach-Object-Process {

    $_.guest.IPAddress |

    ForEach-Object-Process {

        $VMInfo+="<tr><td><center>$($vm.Name)</td><td><center>$($_)</td>"

    }

}

$VMInfo+="</table>"

$VMInfo|Set-Content-Path.\report.html

 

Invoke-Item-Path.\report.html 


Viewing all articles
Browse latest Browse all 258290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>