# ERROR: win\_copy is not a legal parameter in an Ansible task or handler

**URL:** <https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 29, 2015, 7:48pm UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130 "2015-04-29T19:48:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken.krog82](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@ken.krog82](https://forum.ansible.com/u/ken.krog82)\
**Post date:** [April 29, 2015, 7:48pm UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/1 "2015-04-29T19:48:32Z")

</div>

ansible --version  
ansible 2.0.0  
configured module search path = None

I receive this error when attempting to use wincopy.  
But I do see win\_copy in modules

ls /usr/lib/python2.7/site-packages/ansible/modules/core/windows/  
copy.ps1 setup.ps1 win\_copy.pyo win\_feature.pyo win\_get\_url.pyo win\_group.pyo win\_msi.pyo win\_ping.pyo win\_service.pyo win\_stat.pyo win\_user.ps1  
**init**.py slurp.ps1 win\_feature.ps1 win\_get\_url.ps1 win\_group.ps1 win\_msi.ps1 win\_ping.ps1 win\_service.ps1 win\_stat.ps1 win\_template.py win\_user.py  
**init**.pyc win\_copy.py win\_feature.py win\_get\_url.py win\_group.py win\_msi.py win\_ping.py win\_service.py win\_stat.py win\_template.pyc win\_user.pyc  
**init**.pyo win\_copy.pyc win\_feature.pyc win\_get\_url.pyc win\_group.pyc win\_msi.pyc win\_ping.pyc win\_service.pyc win\_stat.pyc win\_template.pyo win\_user.pyo

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 29, 2015, 9:51pm UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/2 "2015-04-29T21:51:27Z")

</div>

its win\_copy, not wincopy.

---

<div class="post-metadata">

**Author:** ![ken.krog82](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@ken.krog82](https://forum.ansible.com/u/ken.krog82)\
**Post date:** [May 1, 2015, 12:32am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/3 "2015-05-01T00:32:24Z")

</div>

That was a typo I am using win\_copy

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 1, 2015, 1:01am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/4 "2015-05-01T01:01:39Z")

</div>

soo, win\_copy is not in ansible (yet) but you seem to have python  
versions of the file (which is only for doc, actual file is .ps1)

---

<div class="post-metadata">

**Author:** ![ken.krog82](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@ken.krog82](https://forum.ansible.com/u/ken.krog82)\
**Post date:** [May 1, 2015, 1:30am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/5 "2015-05-01T01:30:49Z")

</div>

Is it possible to get an early release. If not how do you copy files and templates to a windows machine?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 1, 2015, 1:36am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/6 "2015-05-01T01:36:05Z")

</div>

win\_copy and win\_template ARE in the works, currently only the common  
code is in the repo, we hope to have the plugins soon.

---

<div class="post-metadata">

**Author:** ![ken.krog82](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@ken.krog82](https://forum.ansible.com/u/ken.krog82)\
**Post date:** [May 1, 2015, 1:49am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/7 "2015-05-01T01:49:57Z")

</div>

OK moved them to my library path:

And got this

failed: [ntdvwqwebpcp02b] =\> {“failed”: true, “parsed”: false}  
ConvertTo-Json : Could not load file or assembly ‘System.Web.Extensions,  
Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of  
its dependencies. The paging file is too small for this operation to complete.  
(Exception from HRESULT: 0x800705AF)  
At C:\Users\testaccount\AppData\Local\Temp\ansible-tmp-1430444421.11-4114021981  
1126\setup.ps1:85 char:17

- echo $obj | ConvertTo-Json -Depth 99
- 

```auto

```

- CategoryInfo : NotSpecified: (🙂 [ConvertTo-Json], FileLoadExce  
ption
- FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell  
.Commands.ConvertToJsonCommand

I also get this error if I disable the win\_copy so MS Error.  
Anyone else see this there is a hot fix  
[https://support.microsoft.com/en-us/kb/2842230/en-gb](https://support.microsoft.com/en-us/kb/2842230/en-gb)

More to come.

---

<div class="post-metadata">

**Author:** ![ken.krog82](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@ken.krog82](https://forum.ansible.com/u/ken.krog82)\
**Post date:** [May 1, 2015, 2:32am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/8 "2015-05-01T02:32:29Z")

</div>

Another possible solution though I have failed to find a good one.  
As a note if you are using 64 bit windows then the path might be windows.powershell32

[http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/30/learn-how-to-configure-powershell-memory.aspx](http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/30/learn-how-to-configure-powershell-memory.aspx)

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [May 1, 2015, 7:41am UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/9 "2015-05-01T07:41:51Z")

</div>

Hi,

What version of Windows are you targeting?

Is it a fresh image? Is it up to date with windows updates?

What version of Powershell is running on the windows host?

Can you run any Powershell directly on the windows machine (using the same user that you are connecting as)?

Jon

---

<div class="post-metadata">

**Author:** ![John\_Jelinek](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@John\_Jelinek](https://forum.ansible.com/u/John_Jelinek)\
**Post date:** [May 1, 2015, 2:43pm UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/10 "2015-05-01T14:43:58Z")

</div>

Is a win\_copy (and win\_file / win\_template) plugin anticipated for the v2 launch?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [May 1, 2015, 5:24pm UTC](https://forum.ansible.com/t/error-win-copy-is-not-a-legal-parameter-in-an-ansible-task-or-handler/18130/11 "2015-05-01T17:24:38Z")

</div>

Please see this thread on the development mailing list

[https://groups.google.com/d/msg/ansible-devel/Jl5qP73CiKo/gGHQFaa9QvUJ](https://groups.google.com/d/msg/ansible-devel/Jl5qP73CiKo/gGHQFaa9QvUJ)

Jon
