# Powershell Function via Ansible | Get-AnsibleParam: Missing required argument: \_raw\_params

**URL:** <https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523>\
**Category:** Ansible Project\
**Created:** [January 27, 2021, 3:41pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523 "2021-01-27T15:41:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kzersatz](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Post date:** [January 27, 2021, 3:41pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/1 "2021-01-27T15:41:24Z")

</div>

Executing a rather large playbook revolving around multiple plays to create shares and DFS links, etc.

I’ve got a play to do the following.

---

<div class="post-metadata">

**Author:** ![kzersatz](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Post date:** [January 28, 2021, 4:58pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/2 "2021-01-28T16:58:30Z")

</div>

Crickets  
☹

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 28, 2021, 7:28pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/3 "2021-01-28T19:28:41Z")

</div>

What Ansible version are you running, does it also fail with the same error if you did just “- ansible.windows.win\_shell: echo ‘hi’”. Does win\_command work, what about just “win\_shell” and not the FQCN.

---

<div class="post-metadata">

**Author:** ![kzersatz](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Post date:** [February 1, 2021, 4:40pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/4 "2021-02-01T16:40:19Z")

</div>

I’ve got this that I’m connecting to, doing a metric ton of other things as well, so I’m positive the connection is functional and working.

ansible 2.9.13  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible  
executable location = /usr/local/bin/ansible

python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

-------- Test play

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 1, 2021, 10:29pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/5 "2021-02-01T22:29:26Z")

</div>

The win\_shell and win\_command modules don’t support cmd as an args like command/shell do. It’s complaining that the raw missing is missing because you haven’t done ‘win\_shell: my command’.

---

<div class="post-metadata">

**Author:** ![kzersatz](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Post date:** [February 2, 2021, 1:38pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/6 "2021-02-02T13:38:37Z")

</div>

So pulling this from [docs.ansible.com](http://docs.ansible.com)

- name: Run a command under a non-Powershell interpreter (cmd in this case) ansible.windows.  
win\_shell: echo %HOMEDIR%

args: executable:

cmd

register: homedir\_out

---

<div class="post-metadata">

**Author:** ![kzersatz](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Post date:** [February 2, 2021, 3:33pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/7 "2021-02-02T15:33:42Z")

</div>

I managed to net a better result by specifying the collection at the top of the playbook with  
collections:

- ansible.windows

and making the play

- name: Hi Jason  
win\_shell: echo “HI”

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 2, 2021, 8:19pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/8 "2021-02-02T20:19:55Z")

</div>

So your particular error is because you are using an Ansible version that is too old. You are trying to run the ‘ansible.windows.win\_shell’ collection module but Ansible hardcoded in a check to only allow win\_shell (the builtin version). This has been fixed in recent Ansible versions (I cannot which but at least 2.10) and in any case the ansible.windows version requires Ansible 2.10+ anyway. So you either need to update your Ansible version or not use the ansible.windows collection on 2.9.

---

<div class="post-metadata">

**Author:** ![kzersatz](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Post date:** [February 2, 2021, 8:53pm UTC](https://forum.ansible.com/t/powershell-function-via-ansible-get-ansibleparam-missing-required-argument-raw-params/34523/9 "2021-02-02T20:53:50Z")

</div>

Got it.

I’m attempting to not have to update just yet, we’re integrating Rundeck organization wide and I’m hoping to just need to convert into their environment and call it a day.

Thanks again
