{"action":"created","comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/197887459","pull_request_review_id":131719114,"id":197887459,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Nzg4NzQ1OQ==","diff_hunk":"@@ -43,22 +54,25 @@ internal static bool IsPossibleModuleDirectory(string dir)\n                 }\n                 catch { }\n             }\n-#endif\n \n             return true;\n         }\n \n         /// <summary>\n-        /// Get a list of all module files\n-        /// which can be imported just by specifying a non rooted file name of the module\n-        /// (Import-Module foo\\bar.psm1;  but not Import-Module .\\foo\\bar.psm1)\n+        /// Get all module files by searching the given directory recursively.\n+        /// All sub-directories that could be a module folder will be searched.\n         /// </summary>\n-        /// <remarks>When obtaining all module files we return all possible\n-        /// combinations for a given file. For example, for foo we return both\n-        /// foo.psd1 and foo.psm1 if found. Get-Module will create the module\n-        /// info only for the first one</remarks>\n+        /// <remarks>\n+        /// When obtaining all module files we return all possible combinations for a given file.\n+        /// For example, for 'foo' we return both 'foo.psd1' and 'foo.psm1' if found.\n+        /// Get-Module will create the module info only for the first one.\n+        /// </remarks>\n         internal static IEnumerable<string> GetAllAvailableModuleFiles(string topDirectoryToCheck)\n         {\n+            if (!Directory.Exists(topDirectoryToCheck)) { yield break; }\n+            var options = Utils.PathIsUnc(topDirectoryToCheck) ? s_uncPathEnumOptions : s_defaultEnumOptions;\n+            HashSet<int> fileAtIndexWasReturned = new HashSet<int>();","path":"src/System.Management.Automation/engine/Modules/ModuleUtils.cs","position":72,"original_position":56,"commit_id":"b37a4be571f68e205836e0927b31701de226d5f9","original_commit_id":"ce51f0f2f99c351586e741c66f586703e3770a43","user":{"login":"daxian-dbw","id":127450,"node_id":"MDQ6VXNlcjEyNzQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/127450?v=4","gravatar_id":"","url":"https://api.github.com/users/daxian-dbw","html_url":"https://github.com/daxian-dbw","followers_url":"https://api.github.com/users/daxian-dbw/followers","following_url":"https://api.github.com/users/daxian-dbw/following{/other_user}","gists_url":"https://api.github.com/users/daxian-dbw/gists{/gist_id}","starred_url":"https://api.github.com/users/daxian-dbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daxian-dbw/subscriptions","organizations_url":"https://api.github.com/users/daxian-dbw/orgs","repos_url":"https://api.github.com/users/daxian-dbw/repos","events_url":"https://api.github.com/users/daxian-dbw/events{/privacy}","received_events_url":"https://api.github.com/users/daxian-dbw/received_events","type":"User","site_admin":false},"body":"I think `indexesOfReturnedFiles` may be better.","created_at":"2018-06-25T17:58:40Z","updated_at":"2018-06-25T17:58:40Z","html_url":"https://github.com/PowerShell/PowerShell/pull/7145#discussion_r197887459","pull_request_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/197887459"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/7145#discussion_r197887459"},"pull_request":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145"}},"in_reply_to_id":197572551},"pull_request":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145","id":196828151,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2ODI4MTUx","html_url":"https://github.com/PowerShell/PowerShell/pull/7145","diff_url":"https://github.com/PowerShell/PowerShell/pull/7145.diff","patch_url":"https://github.com/PowerShell/PowerShell/pull/7145.patch","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7145","number":7145,"state":"open","locked":false,"title":"[WIP] Refactor module code related to 'Get-Module -ListAvailable'","user":{"login":"daxian-dbw","id":127450,"node_id":"MDQ6VXNlcjEyNzQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/127450?v=4","gravatar_id":"","url":"https://api.github.com/users/daxian-dbw","html_url":"https://github.com/daxian-dbw","followers_url":"https://api.github.com/users/daxian-dbw/followers","following_url":"https://api.github.com/users/daxian-dbw/following{/other_user}","gists_url":"https://api.github.com/users/daxian-dbw/gists{/gist_id}","starred_url":"https://api.github.com/users/daxian-dbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daxian-dbw/subscriptions","organizations_url":"https://api.github.com/users/daxian-dbw/orgs","repos_url":"https://api.github.com/users/daxian-dbw/repos","events_url":"https://api.github.com/users/daxian-dbw/events{/privacy}","received_events_url":"https://api.github.com/users/daxian-dbw/received_events","type":"User","site_admin":false},"body":"## PR Summary\r\n\r\nThe major refactoring changes are:\r\n- In `ModuleIntrisic.cs`, remove unneeded Windows-PowerShell-only code.\r\n- In `ModuleUtils.cs`, update the different methods that search for module files for different purposes, with better comments.\r\n- In `ModuleCmdletBase.cs` update `Get-Module -ListAvailable` related methods to make the code more maintainable.\r\n\r\n### Issue fixed\r\nMake `Get-Module F:\\tmp\\mpath -ListAvailable -All` actually return all possible modules within the given folder. Previously, it only finds modules that have the same name as the given folder name.\r\n\r\n**Will Add Tests**\r\n\r\n## PR Checklist\r\n\r\n- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)\r\n    - Use the present tense and imperative mood when describing your changes\r\n- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)\r\n- [x] [Change is not breaking](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)\r\n- [ ] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)\r\n- [ ] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).\r\n    - If the PR is work in progress, please add the prefix `WIP:` to the beginning of the title and remove the prefix when the PR is ready.\r\n- **User-facing changes**\r\n    - [ ] Not Applicable\r\n    - **OR**\r\n    - [x] User-facing [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)\r\n        - [ ] Issue filed - Issue link:\r\n- **Testing - New and feature**\r\n    - [ ] Not Applicable or can only be tested interactively\r\n    - **OR**\r\n    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)\r\n        - [x] [Add `[feature]` if the change is significant or affects feature tests](https://github.com/PowerShell/PowerShell/blob/master/docs/testing-guidelines/testing-guidelines.md#requesting-additional-tests-for-a-pr)\r\n","created_at":"2018-06-22T19:42:00Z","updated_at":"2018-06-25T17:58:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a4f7b35ca52aa82f35142c5a77b44dfd2356a80","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":341492760,"node_id":"MDU6TGFiZWwzNDE0OTI3NjA=","url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Area-Documentation","name":"Area-Documentation","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145/commits","review_comments_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145/comments","review_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/7145/comments","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/b37a4be571f68e205836e0927b31701de226d5f9","head":{"label":"daxian-dbw:moduleRefactor","ref":"moduleRefactor","sha":"b37a4be571f68e205836e0927b31701de226d5f9","user":{"login":"daxian-dbw","id":127450,"node_id":"MDQ6VXNlcjEyNzQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/127450?v=4","gravatar_id":"","url":"https://api.github.com/users/daxian-dbw","html_url":"https://github.com/daxian-dbw","followers_url":"https://api.github.com/users/daxian-dbw/followers","following_url":"https://api.github.com/users/daxian-dbw/following{/other_user}","gists_url":"https://api.github.com/users/daxian-dbw/gists{/gist_id}","starred_url":"https://api.github.com/users/daxian-dbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daxian-dbw/subscriptions","organizations_url":"https://api.github.com/users/daxian-dbw/orgs","repos_url":"https://api.github.com/users/daxian-dbw/repos","events_url":"https://api.github.com/users/daxian-dbw/events{/privacy}","received_events_url":"https://api.github.com/users/daxian-dbw/received_events","type":"User","site_admin":false},"repo":{"id":66013539,"node_id":"MDEwOlJlcG9zaXRvcnk2NjAxMzUzOQ==","name":"PowerShell","full_name":"daxian-dbw/PowerShell","owner":{"login":"daxian-dbw","id":127450,"node_id":"MDQ6VXNlcjEyNzQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/127450?v=4","gravatar_id":"","url":"https://api.github.com/users/daxian-dbw","html_url":"https://github.com/daxian-dbw","followers_url":"https://api.github.com/users/daxian-dbw/followers","following_url":"https://api.github.com/users/daxian-dbw/following{/other_user}","gists_url":"https://api.github.com/users/daxian-dbw/gists{/gist_id}","starred_url":"https://api.github.com/users/daxian-dbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daxian-dbw/subscriptions","organizations_url":"https://api.github.com/users/daxian-dbw/orgs","repos_url":"https://api.github.com/users/daxian-dbw/repos","events_url":"https://api.github.com/users/daxian-dbw/events{/privacy}","received_events_url":"https://api.github.com/users/daxian-dbw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daxian-dbw/PowerShell","description":"PowerShell for every system","fork":true,"url":"https://api.github.com/repos/daxian-dbw/PowerShell","forks_url":"https://api.github.com/repos/daxian-dbw/PowerShell/forks","keys_url":"https://api.github.com/repos/daxian-dbw/PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daxian-dbw/PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daxian-dbw/PowerShell/teams","hooks_url":"https://api.github.com/repos/daxian-dbw/PowerShell/hooks","issue_events_url":"https://api.github.com/repos/daxian-dbw/PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/daxian-dbw/PowerShell/events","assignees_url":"https://api.github.com/repos/daxian-dbw/PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/daxian-dbw/PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/daxian-dbw/PowerShell/tags","blobs_url":"https://api.github.com/repos/daxian-dbw/PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daxian-dbw/PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daxian-dbw/PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/daxian-dbw/PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daxian-dbw/PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/daxian-dbw/PowerShell/languages","stargazers_url":"https://api.github.com/repos/daxian-dbw/PowerShell/stargazers","contributors_url":"https://api.github.com/repos/daxian-dbw/PowerShell/contributors","subscribers_url":"https://api.github.com/repos/daxian-dbw/PowerShell/subscribers","subscription_url":"https://api.github.com/repos/daxian-dbw/PowerShell/subscription","commits_url":"https://api.github.com/repos/daxian-dbw/PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/daxian-dbw/PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/daxian-dbw/PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/daxian-dbw/PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/daxian-dbw/PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/daxian-dbw/PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daxian-dbw/PowerShell/merges","archive_url":"https://api.github.com/repos/daxian-dbw/PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daxian-dbw/PowerShell/downloads","issues_url":"https://api.github.com/repos/daxian-dbw/PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/daxian-dbw/PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/daxian-dbw/PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/daxian-dbw/PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daxian-dbw/PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/daxian-dbw/PowerShell/releases{/id}","deployments_url":"https://api.github.com/repos/daxian-dbw/PowerShell/deployments","created_at":"2016-08-18T16:34:35Z","updated_at":"2018-06-15T00:06:41Z","pushed_at":"2018-06-25T17:00:18Z","git_url":"git://github.com/daxian-dbw/PowerShell.git","ssh_url":"git@github.com:daxian-dbw/PowerShell.git","clone_url":"https://github.com/daxian-dbw/PowerShell.git","svn_url":"https://github.com/daxian-dbw/PowerShell","homepage":"","size":39145,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"PowerShell:master","ref":"master","sha":"bbb4f2ea84f6c4a8e8775978178826b61db20bda","user":{"login":"PowerShell","id":11524380,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTI0Mzgw","avatar_url":"https://avatars3.githubusercontent.com/u/11524380?v=4","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":49609581,"node_id":"MDEwOlJlcG9zaXRvcnk0OTYwOTU4MQ==","name":"PowerShell","full_name":"PowerShell/PowerShell","owner":{"login":"PowerShell","id":11524380,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTI0Mzgw","avatar_url":"https://avatars3.githubusercontent.com/u/11524380?v=4","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/PowerShell","description":"PowerShell for every system!","fork":false,"url":"https://api.github.com/repos/PowerShell/PowerShell","forks_url":"https://api.github.com/repos/PowerShell/PowerShell/forks","keys_url":"https://api.github.com/repos/PowerShell/PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PowerShell/PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PowerShell/PowerShell/teams","hooks_url":"https://api.github.com/repos/PowerShell/PowerShell/hooks","issue_events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/PowerShell/PowerShell/events","assignees_url":"https://api.github.com/repos/PowerShell/PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/PowerShell/PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/PowerShell/PowerShell/tags","blobs_url":"https://api.github.com/repos/PowerShell/PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PowerShell/PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PowerShell/PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/PowerShell/PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/PowerShell/PowerShell/languages","stargazers_url":"https://api.github.com/repos/PowerShell/PowerShell/stargazers","contributors_url":"https://api.github.com/repos/PowerShell/PowerShell/contributors","subscribers_url":"https://api.github.com/repos/PowerShell/PowerShell/subscribers","subscription_url":"https://api.github.com/repos/PowerShell/PowerShell/subscription","commits_url":"https://api.github.com/repos/PowerShell/PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/PowerShell/PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/PowerShell/PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/PowerShell/PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PowerShell/PowerShell/merges","archive_url":"https://api.github.com/repos/PowerShell/PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PowerShell/PowerShell/downloads","issues_url":"https://api.github.com/repos/PowerShell/PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/PowerShell/PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/PowerShell/PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/PowerShell/PowerShell/releases{/id}","deployments_url":"https://api.github.com/repos/PowerShell/PowerShell/deployments","created_at":"2016-01-13T23:41:35Z","updated_at":"2018-06-25T17:16:07Z","pushed_at":"2018-06-25T17:15:59Z","git_url":"git://github.com/PowerShell/PowerShell.git","ssh_url":"git@github.com:PowerShell/PowerShell.git","clone_url":"https://github.com/PowerShell/PowerShell.git","svn_url":"https://github.com/PowerShell/PowerShell","homepage":"https://microsoft.com/powershell","size":40016,"stargazers_count":10557,"watchers_count":10557,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1626,"mirror_url":null,"archived":false,"open_issues_count":1510,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1626,"open_issues":1510,"watchers":10557,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/7145"},"issue":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/7145"},"comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/7145/comments"},"review_comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145/comments"},"review_comment":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/7145/commits"},"statuses":{"href":"https://api.github.com/repos/PowerShell/PowerShell/statuses/b37a4be571f68e205836e0927b31701de226d5f9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"daxian-dbw"}}