rkeith2412
asked on
Pass HTML in Powershell object
I have a script that gathers info about VMs and outputs the data to an HTML file. I want to add an HTML link as a property of the object so my output will include a link to a page with more detailed info.
New-Object psobject -Property ([ordered]@{
Name = $vm.Name
Link = "<a href='$($vm.Name).html'>More Info</a>"
State = if ($vm.PowerState -eq "PoweredOn") { "Running" } else { "Off" }
vCPU = $vm.NumCpu
RAM = "$([math]::Round($vm.MemoryGB)) GB"
})
My issue is that Powershell sanitizes my HTML for output by converting < to < so I am left with this<a href='ServerA.html'>More Info</a>
instead of this<a href='ServerA.html'>More Info</a>
Any help with getting Poweshell to pass the text as I intended would be greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.