Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

HTML Content in Powershell HTML Output

$
0
0

How do I include HTML tags in the table output generated by the ConvertTo-HTML command?

For example, if I had an array of objects like this:

FriendlyName,URL

Microsoft,www.microsoft.com

Google,www.google.com

Yahoo,www.yahoo.com

How could I make my ConvertTo-Html output something like this:

<a href="www.microsoft.com">Microsoft</a>

<a href="www.google.com">Google</a>

<a href="www.yahoo.com">Yahoo</a>

I have already tried making another property on my objects (OutHTML) with a string of "<a href=" + [char]34 + $URL + [char]34 + ">" + $FriendlyName + "</a>"

Unfortunately, ConvertTo-Html does its job too well and it converts all of my HTML tags to use &lt; and &gt; so that the < and > will display on the webpage!  Thanks for your help!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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