Very simple copy file command for Windows

There’s a gist floating around of a simple copy module for windows + ansible, but I can’t get it to work. I can use New-Item to create a file on the remote host using this same pattern, but Copy-Item is failing silently. Any ideas?

(This is the entirety of the copy script)
#!powershell

This file is part of Ansible

Looking that the port I did for https://github.com/ansible/ansible-modules-core/pull/384/files I can see I wound up putting a

New-Item -Force $dest -Type file;

before the Copy-Item

I’d be grateful if you could try the modules from here https://github.com/ansible/ansible-modules-core/pull/384/files - which you should be able to use if you are on Ansible 1.9 or later.

If you are still getting failures please can you share an example playbook, ansible version and platform.

Many thanks,

Jon