# Error with win\_service.ps1

**URL:** <https://forum.ansible.com/t/error-with-win-service-ps1/17948>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 10, 2015, 12:55am UTC](https://forum.ansible.com/t/error-with-win-service-ps1/17948 "2015-04-10T00:55:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Dunbar](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@Brian\_Dunbar](https://forum.ansible.com/u/Brian_Dunbar)\
**Post date:** [April 10, 2015, 12:55am UTC](https://forum.ansible.com/t/error-with-win-service-ps1/17948/1 "2015-04-10T00:55:45Z")

</div>

Ansible 1.7.2

First time using any Windows module. I’m using the win\_service module as a test, to restart IIS on a development host.

And it fails ‘file does not have a ‘.ps1’ extension.’

# windows.hosts

[web]  
obfuscatedwebhostname

# windows.yml

- name: iis restart  
win\_service:  
name: “w3svc”  
state: “restarted”

$ ansible-playbook -vvvv -i inventory/windows.hosts windows.yml -t iisreset --ask-vault-pass -l web

(some verbosity redacted)

\< obfuscatedwebhostname \>EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File “C:\Users\risadmin\AppData\Local\Temp\ansible-tmp-1428626910.05-80657711681577\win\_service.ps1” “C:\Users\risadmin\AppData\Local\Temp\ansible-tmp-1428626910.05-80657711681577\arguments”; Remove-Item "C:\Users\risadmin\AppData\Local\Temp\ansible-tmp-1428626910.05-80657711681577" -Force -Recurse;  
\<[ec2-52-1-123-80.compute-1.amazonaws.com](http://ec2-52-1-123-80.compute-1.amazonaws.com)\> WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-EncodedCommand’, ‘enoding redacted because life is short’]  
\<[ec2-52-1-123-80.compute-1.amazonaws.com](http://ec2-52-1-123-80.compute-1.amazonaws.com)\> WINRM RESULT \<Response code 0, out “”, err “Processing -File ‘C’”\>

failed: [[ec2-52-1-123-80.compute-1.amazonaws.com](http://ec2-52-1-123-80.compute-1.amazonaws.com)] =\> {“failed”: true, “parsed”: false}  
invalid output was: Processing -File ‘C’ failed because the file does not have a ‘.ps1’ extension. Specify a valid Windows PowerShell script file name, and then try again.

What the what?

Thanks in advance,

~brian

---

<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:** [April 10, 2015, 8:47am UTC](https://forum.ansible.com/t/error-with-win-service-ps1/17948/2 "2015-04-10T08:47:39Z")

</div>

Looks like you have hit: [https://github.com/ansible/ansible/issues/8588](https://github.com/ansible/ansible/issues/8588) which was fixed during 1.8 development.

Are you in a position to try a newer version of ansible?

All the best,

Jon
