# ERROR! this task 'ansible.windows.win\_command' has extra params

**URL:** <https://forum.ansible.com/t/error-this-task-ansible-windows-win-command-has-extra-params/34805>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 18, 2021, 3:12pm UTC](https://forum.ansible.com/t/error-this-task-ansible-windows-win-command-has-extra-params/34805 "2021-03-18T15:12:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayant\_yadav](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jayant\_yadav](https://forum.ansible.com/u/jayant_yadav)\
**Post date:** [March 18, 2021, 3:12pm UTC](https://forum.ansible.com/t/error-this-task-ansible-windows-win-command-has-extra-params/34805/1 "2021-03-18T15:12:31Z")

</div>

Hi Everyone,

I’m getting this error, I’ve added the playbook below. Please let me know how to fix this error

jayantyadav@DESKTOP-40L7UNL:/etc/ansible$ ansible-playbook editfile.yml  
ERROR! this task ‘ansible.windows.win\_command’ has extra params, which is only allowed in the following modules: raw, include\_role, add\_host, import\_role, include, group\_by, win\_command, command, win\_shell, meta, shell, script, set\_fact, include\_tasks, include\_vars, import\_tasks

The error appears to be in ‘/etc/ansible/editfile.yml’: line 6, column 5, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:

- name: Rename build properties file  
^ here

**Here’s the playbook**  
1 —  
2 - name: update file  
3 hosts: app  
4  
5 tasks:  
6 - name: Rename build properties file  
7 ansible.windows.win\_command: powershell.exe  
8 args:  
9 stdin: Rename-Item -Path C:\Ansible\_Test\_Folder\Ansible\_Test\_File1.txt-NewName.txt  
10 …

---

<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:** [March 18, 2021, 9:18pm UTC](https://forum.ansible.com/t/error-this-task-ansible-windows-win-command-has-extra-params/34805/2 "2021-03-18T21:18:52Z")

</div>

You are using Ansible 2.9 and the ansible.windows collections does not work with this Ansible version (requires 2.10). This is one of the reasons why the minimum version for that collection is 2.10.

Thanks

Jordan
