[ansible@ansible ~]$ cat 02-osinfo.yaml - hosts: windows gather_facts: false tasks: - name: OS info ansible.windows.win_powershell: script: | Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture | ConvertTo-Json -Depth 3 register: osinfo - debug: msg: "{{ osinfo.output[0] }}"