# Executing remote PowerShell script not generating required output

**URL:** <https://forum.ansible.com/t/executing-remote-powershell-script-not-generating-required-output/33770>\
**Category:** Ansible Project\
**Created:** [September 9, 2020, 6:10am UTC](https://forum.ansible.com/t/executing-remote-powershell-script-not-generating-required-output/33770 "2020-09-09T06:10:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [September 9, 2020, 6:10am UTC](https://forum.ansible.com/t/executing-remote-powershell-script-not-generating-required-output/33770/1 "2020-09-09T06:10:20Z")

</div>

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**

---

<div class="post-metadata">

**Author:** ![Avinash\_Jadhav](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Avinash\_Jadhav](https://forum.ansible.com/u/Avinash_Jadhav)\
**Post date:** [September 9, 2020, 6:28am UTC](https://forum.ansible.com/t/executing-remote-powershell-script-not-generating-required-output/33770/2 "2020-09-09T06:28:49Z")

</div>

Hello Harsh,

Please try this one

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