Looking for guidance how to execute powershell win_command with elevated privilege.
My playbook example:
---
- name: Run powershell script
hosts: win
gather_facts: false
tasks:
- name: windows test command
win_command: powershell.exe -
args:
stdin: ipconfig >> c:\ipconfig.txt
This works fine since it doesnt need elevated privilege, but if I try something that requires runas administrator I cannot seem to figure out, tried adding 'become_method: runas' no luck ?