i want to run a power shell script on remote windows machine. The PowerShell script will install software on C drive. The user which used to login is already in administrator group.
But when the command triggered manually in server it works but through ansible it is not working. The ansible task I have configured:
tasks:
- name: Execute PowerShell script
win_shell: |
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Path\to\your\script.ps1"
Any help?