Im using ansible 2.7.5 and a windows 10 host over winRM.
If I execute:
ansible win -I hosts -m win_command -a "PowerShell.exe ipconfig"
I get an output and it works fine.
But I want to write it inside a playbook and not as an ansible command but I won't get any output so I tried to use stdout but it wont work:
- hosts: win
gather_facts: no
tasks:
- name: PowerShell Command
win_command: powershell.exe
register: shell_result
args:
stdin: ipconfig
-debug:
var: shell_result.stdout_lines
Any suggestions how to get the first command working as a playbook?