I wrote this PowerShell script:
- name: Some name
win_shell: |
[xml]$myFile = Get-Content "C:\MyFile.xml"
$myFile.SelectSingleNode("//some-element").InnerText = "new text"
{% if 1 -eq 1 %}
$myFile.SelectSingleNode("//another-element").InnerText = "new text"
{% endif %}
$myFile.Save("C:\MyFile.xml")
and I am getting this error:
"template error while templating string: expected token 'end of statement block'"
Am I doing something wrong? Can someone please help?