# Error message -  "module\_stderr": "/bin/sh: 1: powershell: not found\\n", when running a powershell through win\_command

**URL:** <https://forum.ansible.com/t/error-message-module-stderr-bin-sh-1-powershell-not-found-n-when-running-a-powershell-through-win-command/32304>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [February 22, 2020, 7:08pm UTC](https://forum.ansible.com/t/error-message-module-stderr-bin-sh-1-powershell-not-found-n-when-running-a-powershell-through-win-command/32304 "2020-02-22T19:08:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@Karthik\_Kumar](https://forum.ansible.com/u/Karthik_Kumar)\
**Post date:** [February 22, 2020, 7:08pm UTC](https://forum.ansible.com/t/error-message-module-stderr-bin-sh-1-powershell-not-found-n-when-running-a-powershell-through-win-command/32304/1 "2020-02-22T19:08:15Z")

</div>

Iam trying to run the below simple playbook in ansible in windows 10 through ubuntu installed.

But Iam getting error as “module\_stderr”: “/bin/sh: 1: powershell: not found\n”, “module\_stdout”:  
Please let me know how to resolve this issue.

- name: Run Powershell Scripts  
hosts: localhost  
tasks:
- name: Run powershell script  
win\_command: pwsh.exe -ExecutionPolicy ByPass -File C:/temp/Firstpowershellscript.ps1

---

<div class="post-metadata">

**Author:** ![Pavan\_K\_Kumar](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@Pavan\_K\_Kumar](https://forum.ansible.com/u/Pavan_K_Kumar)\
**Post date:** [April 16, 2020, 9:04am UTC](https://forum.ansible.com/t/error-message-module-stderr-bin-sh-1-powershell-not-found-n-when-running-a-powershell-through-win-command/32304/2 "2020-04-16T09:04:36Z")

</div>

Hi Kiran,

Did you got any fix for this ?

im also facing the same issue…

---

<div class="post-metadata">

**Author:** ![Thanh\_Nguyen\_Duc](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@Thanh\_Nguyen\_Duc](https://forum.ansible.com/u/Thanh_Nguyen_Duc)\
**Post date:** [April 16, 2020, 1:16pm UTC](https://forum.ansible.com/t/error-message-module-stderr-bin-sh-1-powershell-not-found-n-when-running-a-powershell-through-win-command/32304/3 "2020-04-16T13:16:49Z")

</div>

Why localhost? Localhost mean you are running it in the ansible server, not win 10 client
