{"action":"created","comment":{"url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments/44755921","id":44755921,"diff_hunk":"@@ -37,50 +70,82 @@ if ($executionPolicy -ne 'Unrestricted')\n     Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force\n     $rollbackExecution = $true\n }\n+#endregion\n+\n+# Using try/finally to always cleanup even if something awful happens.\n+try\n+{\n \n-try {\n-    # Load in the DSC Configuration\n-    . $PSScriptRoot\\Firewall.ps1\n+####################################################################################################\n \n-    Describe 'xFirewall_Integration' {\n+    <#\n+      This file exists so we can load the test file without necessarily having xNetworking in\n+      the $env:PSModulePath. Otherwise PowerShell will throw an error when reading the Pester File.\n+    #>\n+    $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath \"$DSCResourceName.Config.ps1\"\n+    . $ConfigFile\n+    \n+    Describe \"$($DSCResourceName)_Integration\" {\n+        #region DEFAULT TESTS\n         It 'Should compile without throwing' {\n             {\n                 [System.Environment]::SetEnvironmentVariable('PSModulePath',\n                     $env:PSModulePath,[System.EnvironmentVariableTarget]::Machine)\n-                Firewall -OutputPath $env:Temp\\Firewall\n-                Start-DscConfiguration -Path $env:Temp\\Firewall -ComputerName localhost -Wait -Verbose -Force\n+                Invoke-Expression -Command \"$($DSCResourceName)_Config -OutputPath `$WorkingFolder\"\n+                Start-DscConfiguration -Path (Join-Path -Path $env:Temp -ChildPath $DSCResourceName) `\n+                    -ComputerName localhost -Wait -Verbose -Force\n             } | Should not throw\n         }\n \n         It 'should be able to call Get-DscConfiguration without throwing' {\n-            {Get-DscConfiguration} | Should Not throw\n+            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw\n         }\n+        #endregion\n \n         It 'Should have set the firewall and all the parameters should match' {\n+            # Get the Rule details\n             $firewallRule = Get-NetFireWallRule -Name $rule.Name\n+            $Properties = @{\n+                AddressFilters       = @(Get-NetFirewallAddressFilter -AssociatedNetFirewallRule $FirewallRule)\n+                ApplicationFilters   = @(Get-NetFirewallApplicationFilter -AssociatedNetFirewallRule $FirewallRule)\n+                InterfaceFilters     = @(Get-NetFirewallInterfaceFilter -AssociatedNetFirewallRule $FirewallRule)\n+                InterfaceTypeFilters = @(Get-NetFirewallInterfaceTypeFilter -AssociatedNetFirewallRule $FirewallRule)\n+                PortFilters          = @(Get-NetFirewallPortFilter -AssociatedNetFirewallRule $FirewallRule)\n+                Profile              = @(Get-NetFirewallProfile -AssociatedNetFirewallRule $FirewallRule)\n+                SecurityFilters      = @(Get-NetFirewallSecurityFilter -AssociatedNetFirewallRule $FirewallRule)\n+                ServiceFilters       = @(Get-NetFirewallServiceFilter -AssociatedNetFirewallRule $FirewallRule)\n+            }\n \n-            $firewallRule.Name         | Should Be $rule.Name\n-            $firewallRule.DisplayName  | Should Be $rule.DisplayName\n-            $firewallRule.Group        | Should Be $rule.Group\n-            $firewallRule.Enabled      | Should Be $rule.Enabled\n-            $firewallRule.Profile      | Should Be $rule.Profile\n-            $firewallRule.Action       | Should Be $rule.Action\n-            $firewallRule.Description  | Should Be $rule.Description\n-            $firewallRule.Direction    | Should Be $rule.Direction\n+            # Use the Parameters List to perform these tests\n+            foreach ($p in $ParameterList)","path":"Tests/Integration/MSFT_xFirewall.Integration.Tests.ps1","position":126,"original_position":126,"commit_id":"bed779c0b3eeb6feec1c16bf423afaa428c64dd3","original_commit_id":"bed779c0b3eeb6feec1c16bf423afaa428c64dd3","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":":+1: What would we do without refactoring tools? :smile:","created_at":"2015-11-13T07:20:33Z","updated_at":"2015-11-13T07:20:33Z","html_url":"https://github.com/PowerShell/xNetworking/pull/52#discussion_r44755921","pull_request_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments/44755921"},"html":{"href":"https://github.com/PowerShell/xNetworking/pull/52#discussion_r44755921"},"pull_request":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52","id":50570706,"html_url":"https://github.com/PowerShell/xNetworking/pull/52","diff_url":"https://github.com/PowerShell/xNetworking/pull/52.diff","patch_url":"https://github.com/PowerShell/xNetworking/pull/52.patch","issue_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/52","number":52,"state":"open","locked":false,"title":"Issue 47 - Added Missing Scope Parameters","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 addresses the Issue #47 Missing \"Scope\" Parameters as well as additional work on #46.\r\n\r\nIt contains the following changes:\r\n1. xFirewall Parameters added:\r\n    * Authentication\r\n    * Encryption\r\n    * InterfaceAlias\r\n    * InterfaceType\r\n    * LocalAddress\r\n    * LocalUser\r\n    * Package\r\n    * Platform\r\n    * RemoteAddress\r\n    * RemoteMachine\r\n    * RemoteUser\r\n2. xFirewall resource reworked internally to use an Array that contains a list of all parameters and the source data elements and this is used in both the resource (Get/Set/Test) and the pester tests to eliminate code replication. The array is defined in data region called ParameterList in MSFT_xFirewall.psm1.\r\n3. The profile parameter is now handled correctly as an array internally instead of being converted back and forth between comma delimited string and array.\r\n4. Array comparison for array parameters now done using Compare-Object instead of loop and count comparison.\r\n5. Unit Test template added.\r\n6. Unit Test and Integration Test header/footer code standardized and copied to templates. Header/Footer code should be the same in all tests and test templates. Header/Footer code can now be moved into external helper module like DSCResource.Tools.\r\n7. Integration Test configuration file renamed to MSFT_xFirewall.config.ps1 so that the Integration Test template can automatically figure out the expected name without the user having to set it.\r\n8. Also changed ApplicationPath to Program in samples and Readme.md as it was changed a few PRs ago.\r\n\r\nThat is it for this PR I think.\r\n\r\nThere are still a few parameters needing to be added, but they should be much easier to add now that the parameter list is in an array. I'll add the remaining parameters to a new Issue so we can track that.\r\n\r\nThanks!","created_at":"2015-11-12T21:30:47Z","updated_at":"2015-11-13T07:20:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"376f29884b7504c16f1fd610a0da4a349b2a33e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52/commits","review_comments_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52/comments","review_comment_url":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PowerShell/xNetworking/issues/52/comments","statuses_url":"https://api.github.com/repos/PowerShell/xNetworking/statuses/bed779c0b3eeb6feec1c16bf423afaa428c64dd3","head":{"label":"PlagueHO:Issue47","ref":"Issue47","sha":"bed779c0b3eeb6feec1c16bf423afaa428c64dd3","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-11-12T21:05:58Z","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":511,"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":"4d145c5fcc731d1cf88c32d3b3fbede356d92ab4","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-10-19T22:05:00Z","pushed_at":"2015-11-12T21:30:47Z","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":680,"stargazers_count":7,"watchers_count":7,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":10,"forks":11,"open_issues":10,"watchers":7,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52"},"html":{"href":"https://github.com/PowerShell/xNetworking/pull/52"},"issue":{"href":"https://api.github.com/repos/PowerShell/xNetworking/issues/52"},"comments":{"href":"https://api.github.com/repos/PowerShell/xNetworking/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PowerShell/xNetworking/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/PowerShell/xNetworking/statuses/bed779c0b3eeb6feec1c16bf423afaa428c64dd3"}}}}