# Powershell script runs locally but when run via ansible playbook doesn't produce the expected results.

**URL:** <https://forum.ansible.com/t/powershell-script-runs-locally-but-when-run-via-ansible-playbook-doesnt-produce-the-expected-results/33520>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [July 29, 2020, 2:28pm UTC](https://forum.ansible.com/t/powershell-script-runs-locally-but-when-run-via-ansible-playbook-doesnt-produce-the-expected-results/33520 "2020-07-29T14:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [July 29, 2020, 2:28pm UTC](https://forum.ansible.com/t/powershell-script-runs-locally-but-when-run-via-ansible-playbook-doesnt-produce-the-expected-results/33520/1 "2020-07-29T14:28:45Z")

</div>

Hello Darshan,

Could you please try to below

> **(attachments)**
>
> ![Screen Shot 2020-07-29 at 11.00.47 PM.png](https://us1.discourse-cdn.com/ansible/original/2X/5/5819ca115c4f57dce341d56d6bafb2aa595dc401.png)

---

<div class="post-metadata">

**Author:** ![Darshan\_Yamakanamard](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@Darshan\_Yamakanamard](https://forum.ansible.com/u/Darshan_Yamakanamard)\
**Post date:** [July 29, 2020, 11:57pm UTC](https://forum.ansible.com/t/powershell-script-runs-locally-but-when-run-via-ansible-playbook-doesnt-produce-the-expected-results/33520/2 "2020-07-29T23:57:32Z")

</div>

**Hello Avinash,**

**Thanks for your response. And sorry for this duplicate post. (I missed the response from other community members) The original post is here:** [https://groups.google.com/d/msg/ansible-project/LGtMnY3b32E/XN5bRkBwCQAJ](https://groups.google.com/d/msg/ansible-project/LGtMnY3b32E/XN5bRkBwCQAJ)

**The script module never worked for me.**

fatal: [10.0.0.96]: FAILED! =\> {“changed”: false, “msg”: “Could not find or access ‘C:UsersAdministratorDocumentsservice.ps1’\nSearched in:\n\t/home/ec2-user/site-warmup/gs-int/files/C:UsersAdministratorDocumentsservice.ps1\n\t/home/ec2-user/site-warmup/gs-int/C:UsersAdministratorDocumentsservice.ps1\n\t/home/ec2-user/site-warmup/gs-int/files/C:UsersAdministratorDocumentsservice.ps1\n\t/home/ec2-user/site-warmup/gs-int/C:UsersAdministratorDocumentsservice.ps1 on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote\_src option”}

I tried to copy the script using the win\_copy module and set the remote\_src to true. It kept failing with the weird message. I didn’t spend much time on it as I thought of using win\_shell instead.

Can we discuss this on the original post please?

Regards,  
Darshan
