Executing remote PowerShell script not generating required output

16 views
Skip to first unread message

harsh chawda

unread,
Sep 9, 2020, 2:10:21 AM9/9/20
to Ansible Project
Hello All,

I am trying to execute a PowerShell script present on remote system. It is executing successfully from ansible playbook side.

After execution it should generate a password.csv file on the remote system, but that file is not getting generated.

My plabook:

- name: test
  hosts: test
  tasks:
  - name: warning
    win_shell: powershell.exe -ExecutionPolicy ByPass -File C:\\GeneratePassword.ps1  


Please help me on this if anyone having any idea.

Thanks in advance

Regards
Harsh

Avinash Jadhav

unread,
Sep 9, 2020, 2:29:21 AM9/9/20
to ansible...@googlegroups.com
Hello Harsh,

Please try this one 

- name: test
  hosts: test
  tasks:
  - name: warning
    script: C:\\GeneratePassword.ps1 
    



 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6a1bfc60-b5c9-4d28-b97f-3ee1d8bf0ec2o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages