{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/xNetworking/issues/44","labels_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/44/comments","events_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/44/events","html_url":"https://github.com/PowerShell/xNetworking/issues/44","id":115914010,"number":44,"title":"xFirewall: Modify Set-TargetResource to support both Group/DisplayGroup","user":{"login":"tysonjhayes","id":651851,"avatar_url":"https://avatars.githubusercontent.com/u/651851?v=3","gravatar_id":"","url":"https://api.github.com/users/tysonjhayes","html_url":"https://github.com/tysonjhayes","followers_url":"https://api.github.com/users/tysonjhayes/followers","following_url":"https://api.github.com/users/tysonjhayes/following{/other_user}","gists_url":"https://api.github.com/users/tysonjhayes/gists{/gist_id}","starred_url":"https://api.github.com/users/tysonjhayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tysonjhayes/subscriptions","organizations_url":"https://api.github.com/users/tysonjhayes/orgs","repos_url":"https://api.github.com/users/tysonjhayes/repos","events_url":"https://api.github.com/users/tysonjhayes/events{/privacy}","received_events_url":"https://api.github.com/users/tysonjhayes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-09T16:33:25Z","updated_at":"2015-11-10T06:24:04Z","closed_at":null,"body":"Right now there is a limitation in the code where xFirewall doesn't support setting both Group and DisplayGroup, the code pretty much doesn't let us set Group. This should be changed to allow both."},"comment":{"url":"https://api.github.com/repos/PowerShell/xNetworking/issues/comments/155313778","html_url":"https://github.com/PowerShell/xNetworking/issues/44#issuecomment-155313778","issue_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/44","id":155313778,"user":{"login":"PlagueHO","id":7589164,"avatar_url":"https://avatars.githubusercontent.com/u/7589164?v=3","gravatar_id":"","url":"https://api.github.com/users/PlagueHO","html_url":"https://github.com/PlagueHO","followers_url":"https://api.github.com/users/PlagueHO/followers","following_url":"https://api.github.com/users/PlagueHO/following{/other_user}","gists_url":"https://api.github.com/users/PlagueHO/gists{/gist_id}","starred_url":"https://api.github.com/users/PlagueHO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlagueHO/subscriptions","organizations_url":"https://api.github.com/users/PlagueHO/orgs","repos_url":"https://api.github.com/users/PlagueHO/repos","events_url":"https://api.github.com/users/PlagueHO/events{/privacy}","received_events_url":"https://api.github.com/users/PlagueHO/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T06:24:04Z","updated_at":"2015-11-10T06:24:04Z","body":"I've done some digging on this one and actually think it requires a slightly different solution that I originally thought. This does still require a change, so I'll summarize the situation here so that it is (hopefully) clear why this resource behaves this way and hopefully clarifies things.\r\n\r\nMy original thinking was there is no possible way to set the **DisplayGroup** on an existing or new Firewall rule. It will **always** be set to the value of the **Group** parameter that is passed in the ```New-NetFirewallRule``` cmdlet and once set can **not** be changed by any other cmdlet. It can't even be changed using NETSH or the WFAS UI!!\r\n\r\nBut after researching this I don't think the DisplayGroup is actually never meant to be set. We should ONLY ever allow the Group to be set. The DisplayGroup will always take on one of two values:\r\n1. The same value as the Group.\r\n2. If the group is starts with @ (this means it is a predefined rule) then the display group will be set from the DLL that is specified in the group. For example:\r\n![2015-11-10_18-29-23](https://cloud.githubusercontent.com/assets/7589164/11055219/a048614a-87d9-11e5-9766-8cb23191eb18.png)\r\n![2015-11-10_18-27-52](https://cloud.githubusercontent.com/assets/7589164/11055224/a3088234-87d9-11e5-867f-eb4b13a04dab.png)\r\n\r\nAnother example:\r\nIf you run this:\r\n```new-netfirewallrule -Name Predefined -DisplayName 'Rule Test' -Group '@%windir%\\system32\\ine\r\ntsrv\\iisres.dll,-30503'```\r\n\r\nYou will end up with the DisplayGroup of the rule being pulled from the IISRES.DLL - this is called a **predefined rule** (and you can't change the properties of this rule in WFAS):\r\n![2015-11-10_19-06-28](https://cloud.githubusercontent.com/assets/7589164/11055660/2ed27b4a-87de-11e5-8463-7951037d83fa.png)\r\n\r\nSo I think this also explains why the Group can never be changed once assigned - because it could cause some pretty unexpected behavior when changing a non-predefined rule to a predefined rule.\r\n\r\ntl;dr;\r\nThe solution to all this is:\r\n1. All references to DisplayGroup should be changed to Group because DisplayGroup should never actually be able to be set directly.\r\n2. DisplayGroup should be converted to a READ DSC parameter.\r\n3. Group should be added as a WRITE DSC parameter.\r\n4. If Group is changed on an existing rule the rule will be recreated automatically.\r\n\r\nSo I'll make the above changes and get those through.\r\n\r\nAlso, this makes my submissions to Windows Connect invalid as the Cmdlets are actually behaving exactly as they should. Although the documentation on this could be improved :)"}}