Error message - "module_stderr": "/bin/sh: 1: powershell: not found\n", when running a powershell through win_command

26 views
Skip to first unread message

Karthik Kumar

unread,
Feb 22, 2020, 2:08:16 PM2/22/20
to Ansible Project
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

Pavan K Kumar

unread,
Apr 16, 2020, 5:04:36 AM4/16/20
to Ansible Project
Hi Kiran,

Did you got any fix for this ?

im also facing the same issue.. 

Thanh Nguyen Duc

unread,
Apr 16, 2020, 9:16:42 AM4/16/20
to ansible...@googlegroups.com
Why localhost? Localhost mean you are running it in the ansible server, not win 10 client

Sent from my iPhone

On Apr 16, 2020, at 17:04, Pavan K Kumar <pavank...@gmail.com> wrote:


--
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/0956a7ca-030f-41c6-a1e3-2e5c27b1dc9f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages