# Error with win\_service.ps1

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

</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
