I have a State, which should give me an output if the folder exists or not. I don't know how to escape the name of the folder Programs files so PS knows what I mean.
{% set label = salt['cmd.run']('powershell.exe "test-path \"$env:SystemDrive\\Program Files (x86)\\Folder\""') %}
{% if label == 'True' %}
First:
cmd.run:
- name: Write-Host "Exist"
- shell: powershell
{% else %}
Secondary:
cmd.run:
- name: Write-Host " NOT "
- shell: powershell
{% endif %}
I get NOT each time I try, but the folder exists
Can you tell me how to make this work. And where can I find information on how to escape lines in YAML