That doesn't seem to work, at least the way I'm trying to use it. Here's the code I'm trying to use now:
{% if 'Windows' in grains['os'] %}
{% set PROGRAM_FILES = "%ProgramFiles%" %}
nessus-agent:
pkg.installed:
- order: 1000
link.bat:
cmd.run:
- unless: \"C:\Program Files\Tenable\Nessus\nessuscli\" agent status | grep Linked
- source: salt://win/repo-ng/nessus_agent/link.bat
- order: 1002
{% endif %}
But I get an error:
----------
ID: link.bat
Function: cmd.run
Result: False
Comment: Command "link.bat" run
Started: 14:58:57.624216
Duration: 109.2 ms
Changes:
----------
pid:
4612
retcode:
1
stderr:
'link.bat' is not recognized as an internal or external command,
operable program or batch file.
stdout: