title: Ansible win_shell ad-hoc syntax
body: <p>I'm trying to run the win_shell Ansible module as an ad-hoc command with the "anisble" program instead of in a playbook.  Here is the playbook syntax:</p>
  
  <pre><code>  tasks:
        - win_shell: foo.exe
          args:
                chdir: 'C:\bar'
                executable: cmd
  </code></pre>
  
  <p>I've tried various permutations such as:</p>
  
  <pre><code>ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "executable=cmd"
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args: executable=cmd"
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args=executable: cmd"
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args=(executable=cmd)"
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args={{arg}}" -e '{arg: {executable: cmd} {chdir: "C:\\bar"}}'
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args={{arg}}" -e '{arg: {executable: cmd},{chdir: "C:\\bar"}}'
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args={{arg}}" -e '{"arg": {"executable": "cmd"},{"chdir": "C:\\bar"}}'
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args={{arg}}" -e '{"arg": {"executable": "cmd"},{"chdir": "C:\\bar"}}'
  ansible \* -i windows.inventory -k -m win_shell -a "foo" -a "args={{arg}}" -e '{"arg": {"executable": "cmd"}}'
  </code></pre>
  
  <p>None of these work.</p>
  
  <p>I can do it this way:</p>
  
  <pre><code>ansible \* -i windows.inventory -k -m win_shell -a 'cmd /c "cd C:\bar &amp; foo"'
  </code></pre>
  
  <p>...but I want to know how to do it by specify the "args".</p>