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

Adding invalid hexadecimal values to XML

$
0
0

Hi guys,

I have some code that needs to create an XML Text Node with a string value.

$vArray = "*/New _test/","*/test/ssh?Name=.&"

for($i = 0; $i -lt $vArray.length; $i++)
{
    $xdoc."data_Employ"."conf".AppendChild($xmlPort.CreateElement("FilConf"))
$xdoc."data_Employ"."conf"."FilConf".AppendChild($xmlPort.CreateElement(FilConf[$i]))
}

When I run this I get "powershell hexadecimal value 0x2A is an invalid character" and many more. 

How do I resolve this? I need these characters in the XML doc. 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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