Hi,
I'm running SaltStack 2014.1.3 with a Windows minion, and I'm trying to run a Powershell script on the minion only if a directory or file does not exist. Here is my current test state:
cmd-test:
cmd.script:
- source: salt://scripts/install.ps1
- shell: powershell
- creates: c:\test.txt
The script is executed every time. I have also tried onlyif and unless, but don't know what I can put as the test. I have tried tests like
- unless: cmd /c 'IF EXIST c:\test.txt EXIT 0'
but the tests don't seem to care if the directory/file exists.
Is this supported on Windows? What should my state look like if I want to run a script if a directory does not exist?
Regards,
James