I want to print the angular brackets(<,>) in powershell, but it is printing to > and < instead respectively. Is there any way I can print those symbols.
I have used \ to overcome the bracket's escape properties and also single inverted commas but the result remains same.
$xml = [xml](Get-Content -Path C:\Users\Desktop\new.xml)
$xml.Deploy.app="$<abc\bc>"
$xml.Save("C:\Users\Desktop\new.xml")
I expected output to be
<?xml version="1.0"?>
<Deploy>
<app><abc\bc></app>
</Deploy>
but it printing
<?xml version="1.0"?>
<Deploy>
<app><abc\bc></app>
</Deploy>
Thanks in advance!!
This is just how XML works. The less than and greater than characters are reserved/special characters. When a value includes them it will convert them to their escaped forms
<and>. What you expect to be output is invalid XML.