{"action":"created","comment":{"url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments/48299871","id":48299871,"diff_hunk":"@@ -0,0 +1,173 @@\n+data LocalizedData\n+{\n+    # culture=\"en-US\"\n+    ConvertFrom-StringData -StringData @'\n+GettingDHCPClientMessage=Getting the DHCP Client on {1} interface \"{0}\".\n+ApplyingDHCPClientMessage=Applying the DHCP Client on {1} interface \"{0}\".\n+DHCPClientSetStateMessage=DHCP Client was set to the desired state {2} on {1} interface \"{0}\".\n+CheckingDHCPClientMessage=Checking the DHCP Client on {1} interface \"{0}\".\n+DHCPClientDoesNotMatchMessage=DHCP Client is not in the desired state {2} on {1} interface \"{0}\".\n+InterfaceNotAvailableError=Interface \"{0}\" is not available. Please select a valid interface and try again.\n+'@\n+}\n+\n+function Get-TargetResource\n+{\n+    [OutputType([System.Collections.Hashtable])]\n+    param\n+    (\n+        [Parameter(Mandatory)]\n+        [ValidateNotNullOrEmpty()]\n+        [String] $InterfaceAlias,\n+\n+        [Parameter(Mandatory)]\n+        [ValidateSet('IPv4', 'IPv6')]\n+        [String] $AddressFamily,\n+\n+        [Parameter(Mandatory)]\n+        [ValidateSet('Enabled', 'Disabled')]\n+        [String] $State\n+    )\n+\n+    Write-Verbose -Message ( @( \"$($MyInvocation.MyCommand): \"\n+        $($LocalizedData.GettingDHCPClientMessage) `\n+        -f $InterfaceAlias,$AddressFamily `\n+        ) -join '')\n+\n+    Test-ResourceProperty @PSBoundParameters\n+    \n+    $CurrentDHCPClient = Get-NetIPInterface `\n+        -InterfaceAlias $InterfaceAlias `\n+        -AddressFamily $AddressFamily\n+\n+    $returnValue = @{\n+        State          = $CurrentDHCPClient.Dhcp\n+        AddressFamily  = $AddressFamily\n+        InterfaceAlias = $InterfaceAlias\n+    }\n+\n+    $returnValue\n+}\n+\n+function Set-TargetResource\n+{\n+    param\n+    (\n+        [Parameter(Mandatory)]\n+        [ValidateNotNullOrEmpty()]\n+        [String] $InterfaceAlias,\n+\n+        [Parameter(Mandatory)]\n+        [ValidateSet('IPv4', 'IPv6')]\n+        [String] $AddressFamily,\n+\n+        [Parameter(Mandatory)]\n+        [ValidateSet('Enabled', 'Disabled')]\n+        [String] $State\n+    )\n+\n+    Write-Verbose -Message ( @( \"$($MyInvocation.MyCommand): \"\n+        $($LocalizedData.ApplyingDHCPClientMessage) `\n+        -f $InterfaceAlias,$AddressFamily `\n+        ) -join '')\n+\n+    Test-ResourceProperty @PSBoundParameters\n+    \n+    $CurrentDHCPClient = Get-NetIPInterface `\n+        -InterfaceAlias $InterfaceAlias `\n+        -AddressFamily $AddressFamily\n+        \n+    # The DHCP Client is in a different state - so change it.\n+    if ($CurrentDHCPClient.DHCP -ne $State)","path":"DSCResources/MSFT_xDhcpClient/MSFT_xDhcpClient.psm1","position":81,"original_position":81,"commit_id":"d9ce40698d673852703451d7623f28a728d21f5e","original_commit_id":"d9ce40698d673852703451d7623f28a728d21f5e","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},"body":"So if Set-TargetResource shouldn't ever fire unless there is a difference why are we checking the status again? Seems redundant.","created_at":"2015-12-22T21:25:50Z","updated_at":"2015-12-22T21:25:50Z","html_url":"https://github.com/PowerShell/xNetworking/pull/70#discussion_r48299871","pull_request_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments/48299871"},"html":{"href":"https://github.com/PowerShell/xNetworking/pull/70#discussion_r48299871"},"pull_request":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70","id":54331934,"html_url":"https://github.com/PowerShell/xNetworking/pull/70","diff_url":"https://github.com/PowerShell/xNetworking/pull/70.diff","patch_url":"https://github.com/PowerShell/xNetworking/pull/70.patch","issue_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/70","number":70,"state":"open","locked":false,"title":"Resolve Issue #68 - Added xDHCPClient Resource","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},"body":"This PR adds the xDHCPClient resource that enables DHCP to be enabled/disabled on a per Adapter/AddressFamily basis.\r\n\r\nIt also removes the test for DHCP status in the xIPAddress resource.\r\n\r\nUnit tests are included, but Integration tests aren't because I haven't figured out a way to implement the integration test without disrupting network connectivity.\r\n\r\nThis should address Issue #32 and Issue #17.\r\n","created_at":"2015-12-22T04:29:55Z","updated_at":"2015-12-22T21:25:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e8d8ea6bcabed060ced53284958398d4f94f5f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70/commits","review_comments_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70/comments","review_comment_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/70/comments","statuses_url":"https://api.github.com/repos/PowerShell/xNetworking/statuses/d9ce40698d673852703451d7623f28a728d21f5e","head":{"label":"PlagueHO:Issue-68","ref":"Issue-68","sha":"d9ce40698d673852703451d7623f28a728d21f5e","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},"repo":{"id":41977867,"name":"xNetworking","full_name":"PlagueHO/xNetworking","owner":{"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},"private":false,"html_url":"https://github.com/PlagueHO/xNetworking","description":null,"fork":true,"url":"https://api.github.com/repos/PlagueHO/xNetworking","forks_url":"https://api.github.com/repos/PlagueHO/xNetworking/forks","keys_url":"https://api.github.com/repos/PlagueHO/xNetworking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PlagueHO/xNetworking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PlagueHO/xNetworking/teams","hooks_url":"https://api.github.com/repos/PlagueHO/xNetworking/hooks","issue_events_url":"https://api.github.com/repos/PlagueHO/xNetworking/issues/events{/number}","events_url":"https://api.github.com/repos/PlagueHO/xNetworking/events","assignees_url":"https://api.github.com/repos/PlagueHO/xNetworking/assignees{/user}","branches_url":"https://api.github.com/repos/PlagueHO/xNetworking/branches{/branch}","tags_url":"https://api.github.com/repos/PlagueHO/xNetworking/tags","blobs_url":"https://api.github.com/repos/PlagueHO/xNetworking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PlagueHO/xNetworking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PlagueHO/xNetworking/git/refs{/sha}","trees_url":"https://api.github.com/repos/PlagueHO/xNetworking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PlagueHO/xNetworking/statuses/{sha}","languages_url":"https://api.github.com/repos/PlagueHO/xNetworking/languages","stargazers_url":"https://api.github.com/repos/PlagueHO/xNetworking/stargazers","contributors_url":"https://api.github.com/repos/PlagueHO/xNetworking/contributors","subscribers_url":"https://api.github.com/repos/PlagueHO/xNetworking/subscribers","subscription_url":"https://api.github.com/repos/PlagueHO/xNetworking/subscription","commits_url":"https://api.github.com/repos/PlagueHO/xNetworking/commits{/sha}","git_commits_url":"https://api.github.com/repos/PlagueHO/xNetworking/git/commits{/sha}","comments_url":"https://api.github.com/repos/PlagueHO/xNetworking/comments{/number}","issue_comment_url":"https://api.github.com/repos/PlagueHO/xNetworking/issues/comments{/number}","contents_url":"https://api.github.com/repos/PlagueHO/xNetworking/contents/{+path}","compare_url":"https://api.github.com/repos/PlagueHO/xNetworking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PlagueHO/xNetworking/merges","archive_url":"https://api.github.com/repos/PlagueHO/xNetworking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PlagueHO/xNetworking/downloads","issues_url":"https://api.github.com/repos/PlagueHO/xNetworking/issues{/number}","pulls_url":"https://api.github.com/repos/PlagueHO/xNetworking/pulls{/number}","milestones_url":"https://api.github.com/repos/PlagueHO/xNetworking/milestones{/number}","notifications_url":"https://api.github.com/repos/PlagueHO/xNetworking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PlagueHO/xNetworking/labels{/name}","releases_url":"https://api.github.com/repos/PlagueHO/xNetworking/releases{/id}","created_at":"2015-09-05T22:37:55Z","updated_at":"2015-09-05T22:37:56Z","pushed_at":"2015-12-22T21:25:16Z","git_url":"git://github.com/PlagueHO/xNetworking.git","ssh_url":"git@github.com:PlagueHO/xNetworking.git","clone_url":"https://github.com/PlagueHO/xNetworking.git","svn_url":"https://github.com/PlagueHO/xNetworking","homepage":null,"size":375,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"PowerShell:dev","ref":"dev","sha":"53bbf6bc38d5d7527c63c04ed5cd523e38ea317f","user":{"login":"PowerShell","id":11524380,"avatar_url":"https://avatars.githubusercontent.com/u/11524380?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerShell","html_url":"https://github.com/PowerShell","followers_url":"https://api.github.com/users/PowerShell/followers","following_url":"https://api.github.com/users/PowerShell/following{/other_user}","gists_url":"https://api.github.com/users/PowerShell/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerShell/subscriptions","organizations_url":"https://api.github.com/users/PowerShell/orgs","repos_url":"https://api.github.com/users/PowerShell/repos","events_url":"https://api.github.com/users/PowerShell/events{/privacy}","received_events_url":"https://api.github.com/users/PowerShell/received_events","type":"Organization","site_admin":false},"repo":{"id":34022240,"name":"xNetworking","full_name":"PowerShell/xNetworking","owner":{"login":"PowerShell","id":11524380,"avatar_url":"https://avatars.githubusercontent.com/u/11524380?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerShell","html_url":"https://github.com/PowerShell","followers_url":"https://api.github.com/users/PowerShell/followers","following_url":"https://api.github.com/users/PowerShell/following{/other_user}","gists_url":"https://api.github.com/users/PowerShell/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerShell/subscriptions","organizations_url":"https://api.github.com/users/PowerShell/orgs","repos_url":"https://api.github.com/users/PowerShell/repos","events_url":"https://api.github.com/users/PowerShell/events{/privacy}","received_events_url":"https://api.github.com/users/PowerShell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PowerShell/xNetworking","description":null,"fork":false,"url":"https://api.github.com/repos/PowerShell/xNetworking","forks_url":"https://api.github.com/repos/PowerShell/xNetworking/forks","keys_url":"https://api.github.com/repos/PowerShell/xNetworking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PowerShell/xNetworking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PowerShell/xNetworking/teams","hooks_url":"https://api.github.com/repos/PowerShell/xNetworking/hooks","issue_events_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/events{/number}","events_url":"https://api.github.com/repos/PowerShell/xNetworking/events","assignees_url":"https://api.github.com/repos/PowerShell/xNetworking/assignees{/user}","branches_url":"https://api.github.com/repos/PowerShell/xNetworking/branches{/branch}","tags_url":"https://api.github.com/repos/PowerShell/xNetworking/tags","blobs_url":"https://api.github.com/repos/PowerShell/xNetworking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PowerShell/xNetworking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PowerShell/xNetworking/git/refs{/sha}","trees_url":"https://api.github.com/repos/PowerShell/xNetworking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PowerShell/xNetworking/statuses/{sha}","languages_url":"https://api.github.com/repos/PowerShell/xNetworking/languages","stargazers_url":"https://api.github.com/repos/PowerShell/xNetworking/stargazers","contributors_url":"https://api.github.com/repos/PowerShell/xNetworking/contributors","subscribers_url":"https://api.github.com/repos/PowerShell/xNetworking/subscribers","subscription_url":"https://api.github.com/repos/PowerShell/xNetworking/subscription","commits_url":"https://api.github.com/repos/PowerShell/xNetworking/commits{/sha}","git_commits_url":"https://api.github.com/repos/PowerShell/xNetworking/git/commits{/sha}","comments_url":"https://api.github.com/repos/PowerShell/xNetworking/comments{/number}","issue_comment_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/comments{/number}","contents_url":"https://api.github.com/repos/PowerShell/xNetworking/contents/{+path}","compare_url":"https://api.github.com/repos/PowerShell/xNetworking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PowerShell/xNetworking/merges","archive_url":"https://api.github.com/repos/PowerShell/xNetworking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PowerShell/xNetworking/downloads","issues_url":"https://api.github.com/repos/PowerShell/xNetworking/issues{/number}","pulls_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls{/number}","milestones_url":"https://api.github.com/repos/PowerShell/xNetworking/milestones{/number}","notifications_url":"https://api.github.com/repos/PowerShell/xNetworking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PowerShell/xNetworking/labels{/name}","releases_url":"https://api.github.com/repos/PowerShell/xNetworking/releases{/id}","created_at":"2015-04-15T22:43:02Z","updated_at":"2015-12-09T08:51:21Z","pushed_at":"2015-12-22T15:39:40Z","git_url":"git://github.com/PowerShell/xNetworking.git","ssh_url":"git@github.com:PowerShell/xNetworking.git","clone_url":"https://github.com/PowerShell/xNetworking.git","svn_url":"https://github.com/PowerShell/xNetworking","homepage":null,"size":365,"stargazers_count":9,"watchers_count":9,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":11,"forks":15,"open_issues":11,"watchers":9,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70"},"html":{"href":"https://github.com/PowerShell/xNetworking/pull/70"},"issue":{"href":"https://api.github.com/repos/PowerShell/xNetworking/issues/70"},"comments":{"href":"https://api.github.com/repos/PowerShell/xNetworking/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/PowerShell/xNetworking/statuses/d9ce40698d673852703451d7623f28a728d21f5e"}}}}