# win\_feature failing

**URL:** <https://forum.ansible.com/t/win-feature-failing/22247>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 9, 2016, 6:31pm UTC](https://forum.ansible.com/t/win-feature-failing/22247 "2016-08-09T18:31:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Dugan](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Justin\_Dugan](https://forum.ansible.com/u/Justin_Dugan)\
**Post date:** [August 9, 2016, 6:31pm UTC](https://forum.ansible.com/t/win-feature-failing/22247/1 "2016-08-09T18:31:40Z")

</div>

I am trying to use win\_feature on a Windows 2008 R2 Server and reviving the following error:

FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Method invocation failed because [System.Management.Automation.PSCustomObject] doesn’t contain a method named ‘Remove’.”}

The server is running PowerShell 3.0. I tried updating this to 4.0 because win\_feature is working on a 2012 Server, but this didn’t resolve the problem.

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![Justin\_Dugan](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Justin\_Dugan](https://forum.ansible.com/u/Justin_Dugan)\
**Post date:** [August 9, 2016, 6:44pm UTC](https://forum.ansible.com/t/win-feature-failing/22247/2 "2016-08-09T18:44:58Z")

</div>

Here is the playbook entry:

- name: Install IIS Windows 2007  
win\_feature:  
name: “AS-AppServer-Ext,AS-MSMQ-Activation,AS-TCP-Activation,AS-Named-Pipes,FS-FileServer,Web-St  
atic-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Http-Redirect,Web-Asp-Net,Web-Net-  
Ext,Web-ASP,Web-CGI,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Includes,Web-Http-Logging,Web-Log-Libraries,W  
eb-Request-Monitor,Web-Http-Tracing,Web-Basic-Auth,Web-Windows-Auth,Web-Digest-Auth,Web-Client-Auth,  
Web-Cert-Auth,Web-Url-Auth,Web-Filtering,Web-IP-Security,Web-Mgmt-Console,Web-Scripting-Tools,Web-Mg  
mt-Service,Web-Metabase,Web-WMI,Web-Lgcy-Scripting,Web-Lgcy-Mgmt-Console,NET-Framework-Core,NET-HTTP  
-Activation,NET-Non-HTTP-Activ,MSMQ-Server,RSAT-Web-Server,PowerShell-ISE,WAS-Process-Model,WAS-NET-  
Environment,WAS-Config-APIs”  
state: present  
include\_management\_tools: yes

Also, the error only happens on state=present. state=absent works fine.

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [August 10, 2016, 12:45am UTC](https://forum.ansible.com/t/win-feature-failing/22247/3 "2016-08-10T00:45:16Z")

</div>

Hi Justin,  
Just to confirm: Its working on server 2012 but not on 208R2 (regardless of PS version), is that right? I have to admit I use 2012R2 for testing, so there might be bugs like this slipping thru. Please confirm, and I’ll try and have a look at this asap.

---

<div class="post-metadata">

**Author:** ![Justin\_Dugan](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Justin\_Dugan](https://forum.ansible.com/u/Justin_Dugan)\
**Post date:** [August 10, 2016, 2:32am UTC](https://forum.ansible.com/t/win-feature-failing/22247/4 "2016-08-10T02:32:50Z")

</div>

Yes, it's working in 2012,but not 2008r2.
