Developing Windows modules: module is missing interpreter line

Hi all,
From time to time I’m getting this strange error:
“module is missing interpreter line”. I’m developing several windows modules which i drop into library/windows. When I execute a playbook including the newly created module, I get that strange error.

I’ve compared my files to the ones included in the devel branch, and cannot find any differences. If I navigate to where Ansible drops the files along with the arguments file in the filesystem and execute them, they run succesfully, outputting json data.

How can I troubleshoot this? I’ve included a test module just in case anyone finds that interesting.

(attachments)

win_chocolatey.ps1 (1.67 KB)

The file you attached has the UTF-8 byte order mark at the beginning (0xef,
0xbb, 0xbf), which may have been added automatically by your editor on
Windows. Ansible isn't expecting it and therefore fails to find the
shebang line at the beginning of the file.

That was it. Thanks!

Nice find Chris!

I’m guessing we could modify our interpreter check to ignore those things.