{"action":"created","comment":{"url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/comments/23151608","id":23151608,"diff_hunk":"@@ -211,6 +220,53 @@ protected override void Initialize()\n             }\r\n         }\r\n \r\n+        public static bool ValidateInstalledPowerShellVersion()\r\n+        {\r\n+            if (InstalledPowerShellVersion < new Version(3, 0))\r\n+            {\r\n+                if (MessageBox.Show(\r\n+                    Resources.MissingPowerShellVersion,\r\n+                    Resources.MissingDependency,\r\n+                    MessageBoxButton.YesNo,\r\n+                    MessageBoxImage.Warning) == MessageBoxResult.Yes)\r\n+                {\r\n+                    System.Diagnostics.Process.Start(\"http://go.microsoft.com/fwlink/?LinkID=524571\");\r\n+                }\r\n+                return false;\r\n+            }\r\n+            return true;\r\n+        }\r\n+\r\n+        public static Version InstalledPowerShellVersion\r\n+        {\r\n+            get\r\n+            {\r\n+                var version = new Version(0, 0);\r\n+                using (var reg = Registry.LocalMachine.OpenSubKey(@\"Software\\Microsoft\\PowerShell\\3\\PowerShellEngine\"))\r\n+                {\r\n+                    if (reg != null)\r\n+                    {\r\n+                        var versionString = reg.GetValue(\"PowerShellVersion\") as string;\r\n+\r\n+                        Version.TryParse(versionString, out version);\r\n+                        return version;\r\n+                    }\r\n+                }\r\n+\r\n+                using (var reg = Registry.LocalMachine.OpenSubKey(@\"Software\\Microsoft\\PowerShell\\1\\PowerShellEngine\"))\r\n+                {\r\n+                    if (reg != null)\r\n+                    {\r\n+                        var versionString = reg.GetValue(\"PowerShellVersion\") as string;\r\n+                        Version.TryParse(versionString, out version);\r","path":"PowerShellTools/PowerShellToolsPackage.cs","position":79,"original_position":79,"commit_id":"ae73a5e62b3acf07b1ac70ad108f0addd9b399ea","original_commit_id":"ae73a5e62b3acf07b1ac70ad108f0addd9b399ea","user":{"login":"AndreSayreMSFT","id":10080679,"avatar_url":"https://avatars.githubusercontent.com/u/10080679?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreSayreMSFT","html_url":"https://github.com/AndreSayreMSFT","followers_url":"https://api.github.com/users/AndreSayreMSFT/followers","following_url":"https://api.github.com/users/AndreSayreMSFT/following{/other_user}","gists_url":"https://api.github.com/users/AndreSayreMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreSayreMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreSayreMSFT/subscriptions","organizations_url":"https://api.github.com/users/AndreSayreMSFT/orgs","repos_url":"https://api.github.com/users/AndreSayreMSFT/repos","events_url":"https://api.github.com/users/AndreSayreMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/AndreSayreMSFT/received_events","type":"User","site_admin":false},"body":"Same comment as above re: versionString being null","created_at":"2015-01-19T10:22:11Z","updated_at":"2015-01-19T10:22:11Z","html_url":"https://github.com/adamdriscoll/poshtools/pull/164#discussion_r23151608","pull_request_url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/comments/23151608"},"html":{"href":"https://github.com/adamdriscoll/poshtools/pull/164#discussion_r23151608"},"pull_request":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164","id":27563242,"html_url":"https://github.com/adamdriscoll/poshtools/pull/164","diff_url":"https://github.com/adamdriscoll/poshtools/pull/164.diff","patch_url":"https://github.com/adamdriscoll/poshtools/pull/164.patch","issue_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/164","number":164,"state":"open","locked":false,"title":"Implementing #38","user":{"login":"adamdriscoll","id":1256531,"avatar_url":"https://avatars.githubusercontent.com/u/1256531?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdriscoll","html_url":"https://github.com/adamdriscoll","followers_url":"https://api.github.com/users/adamdriscoll/followers","following_url":"https://api.github.com/users/adamdriscoll/following{/other_user}","gists_url":"https://api.github.com/users/adamdriscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdriscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdriscoll/subscriptions","organizations_url":"https://api.github.com/users/adamdriscoll/orgs","repos_url":"https://api.github.com/users/adamdriscoll/repos","events_url":"https://api.github.com/users/adamdriscoll/events{/privacy}","received_events_url":"https://api.github.com/users/adamdriscoll/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-17T22:25:26Z","updated_at":"2015-01-19T10:22:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b00b6ff1487cf9cea41edb7d5d7b188068cdc659","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164/commits","review_comments_url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164/comments","review_comment_url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/comments/{number}","comments_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/164/comments","statuses_url":"https://api.github.com/repos/adamdriscoll/poshtools/statuses/ae73a5e62b3acf07b1ac70ad108f0addd9b399ea","head":{"label":"adamdriscoll:bug-38","ref":"bug-38","sha":"ae73a5e62b3acf07b1ac70ad108f0addd9b399ea","user":{"login":"adamdriscoll","id":1256531,"avatar_url":"https://avatars.githubusercontent.com/u/1256531?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdriscoll","html_url":"https://github.com/adamdriscoll","followers_url":"https://api.github.com/users/adamdriscoll/followers","following_url":"https://api.github.com/users/adamdriscoll/following{/other_user}","gists_url":"https://api.github.com/users/adamdriscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdriscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdriscoll/subscriptions","organizations_url":"https://api.github.com/users/adamdriscoll/orgs","repos_url":"https://api.github.com/users/adamdriscoll/repos","events_url":"https://api.github.com/users/adamdriscoll/events{/privacy}","received_events_url":"https://api.github.com/users/adamdriscoll/received_events","type":"User","site_admin":false},"repo":{"id":8570875,"name":"poshtools","full_name":"adamdriscoll/poshtools","owner":{"login":"adamdriscoll","id":1256531,"avatar_url":"https://avatars.githubusercontent.com/u/1256531?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdriscoll","html_url":"https://github.com/adamdriscoll","followers_url":"https://api.github.com/users/adamdriscoll/followers","following_url":"https://api.github.com/users/adamdriscoll/following{/other_user}","gists_url":"https://api.github.com/users/adamdriscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdriscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdriscoll/subscriptions","organizations_url":"https://api.github.com/users/adamdriscoll/orgs","repos_url":"https://api.github.com/users/adamdriscoll/repos","events_url":"https://api.github.com/users/adamdriscoll/events{/privacy}","received_events_url":"https://api.github.com/users/adamdriscoll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamdriscoll/poshtools","description":"PowerShell integration for Visual Studio 2012 and 2013.","fork":false,"url":"https://api.github.com/repos/adamdriscoll/poshtools","forks_url":"https://api.github.com/repos/adamdriscoll/poshtools/forks","keys_url":"https://api.github.com/repos/adamdriscoll/poshtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamdriscoll/poshtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamdriscoll/poshtools/teams","hooks_url":"https://api.github.com/repos/adamdriscoll/poshtools/hooks","issue_events_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/events{/number}","events_url":"https://api.github.com/repos/adamdriscoll/poshtools/events","assignees_url":"https://api.github.com/repos/adamdriscoll/poshtools/assignees{/user}","branches_url":"https://api.github.com/repos/adamdriscoll/poshtools/branches{/branch}","tags_url":"https://api.github.com/repos/adamdriscoll/poshtools/tags","blobs_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamdriscoll/poshtools/statuses/{sha}","languages_url":"https://api.github.com/repos/adamdriscoll/poshtools/languages","stargazers_url":"https://api.github.com/repos/adamdriscoll/poshtools/stargazers","contributors_url":"https://api.github.com/repos/adamdriscoll/poshtools/contributors","subscribers_url":"https://api.github.com/repos/adamdriscoll/poshtools/subscribers","subscription_url":"https://api.github.com/repos/adamdriscoll/poshtools/subscription","commits_url":"https://api.github.com/repos/adamdriscoll/poshtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamdriscoll/poshtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/comments/{number}","contents_url":"https://api.github.com/repos/adamdriscoll/poshtools/contents/{+path}","compare_url":"https://api.github.com/repos/adamdriscoll/poshtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamdriscoll/poshtools/merges","archive_url":"https://api.github.com/repos/adamdriscoll/poshtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamdriscoll/poshtools/downloads","issues_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues{/number}","pulls_url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls{/number}","milestones_url":"https://api.github.com/repos/adamdriscoll/poshtools/milestones{/number}","notifications_url":"https://api.github.com/repos/adamdriscoll/poshtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamdriscoll/poshtools/labels{/name}","releases_url":"https://api.github.com/repos/adamdriscoll/poshtools/releases{/id}","created_at":"2013-03-05T02:59:17Z","updated_at":"2015-01-17T22:26:17Z","pushed_at":"2015-01-17T22:42:16Z","git_url":"git://github.com/adamdriscoll/poshtools.git","ssh_url":"git@github.com:adamdriscoll/poshtools.git","clone_url":"https://github.com/adamdriscoll/poshtools.git","svn_url":"https://github.com/adamdriscoll/poshtools","homepage":"","size":6713,"stargazers_count":199,"watchers_count":199,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":58,"forks":49,"open_issues":58,"watchers":199,"default_branch":"dev"}},"base":{"label":"adamdriscoll:dev","ref":"dev","sha":"baf8c38acba04463bf3e427ff764b99454c01df6","user":{"login":"adamdriscoll","id":1256531,"avatar_url":"https://avatars.githubusercontent.com/u/1256531?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdriscoll","html_url":"https://github.com/adamdriscoll","followers_url":"https://api.github.com/users/adamdriscoll/followers","following_url":"https://api.github.com/users/adamdriscoll/following{/other_user}","gists_url":"https://api.github.com/users/adamdriscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdriscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdriscoll/subscriptions","organizations_url":"https://api.github.com/users/adamdriscoll/orgs","repos_url":"https://api.github.com/users/adamdriscoll/repos","events_url":"https://api.github.com/users/adamdriscoll/events{/privacy}","received_events_url":"https://api.github.com/users/adamdriscoll/received_events","type":"User","site_admin":false},"repo":{"id":8570875,"name":"poshtools","full_name":"adamdriscoll/poshtools","owner":{"login":"adamdriscoll","id":1256531,"avatar_url":"https://avatars.githubusercontent.com/u/1256531?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdriscoll","html_url":"https://github.com/adamdriscoll","followers_url":"https://api.github.com/users/adamdriscoll/followers","following_url":"https://api.github.com/users/adamdriscoll/following{/other_user}","gists_url":"https://api.github.com/users/adamdriscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdriscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdriscoll/subscriptions","organizations_url":"https://api.github.com/users/adamdriscoll/orgs","repos_url":"https://api.github.com/users/adamdriscoll/repos","events_url":"https://api.github.com/users/adamdriscoll/events{/privacy}","received_events_url":"https://api.github.com/users/adamdriscoll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamdriscoll/poshtools","description":"PowerShell integration for Visual Studio 2012 and 2013.","fork":false,"url":"https://api.github.com/repos/adamdriscoll/poshtools","forks_url":"https://api.github.com/repos/adamdriscoll/poshtools/forks","keys_url":"https://api.github.com/repos/adamdriscoll/poshtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamdriscoll/poshtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamdriscoll/poshtools/teams","hooks_url":"https://api.github.com/repos/adamdriscoll/poshtools/hooks","issue_events_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/events{/number}","events_url":"https://api.github.com/repos/adamdriscoll/poshtools/events","assignees_url":"https://api.github.com/repos/adamdriscoll/poshtools/assignees{/user}","branches_url":"https://api.github.com/repos/adamdriscoll/poshtools/branches{/branch}","tags_url":"https://api.github.com/repos/adamdriscoll/poshtools/tags","blobs_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamdriscoll/poshtools/statuses/{sha}","languages_url":"https://api.github.com/repos/adamdriscoll/poshtools/languages","stargazers_url":"https://api.github.com/repos/adamdriscoll/poshtools/stargazers","contributors_url":"https://api.github.com/repos/adamdriscoll/poshtools/contributors","subscribers_url":"https://api.github.com/repos/adamdriscoll/poshtools/subscribers","subscription_url":"https://api.github.com/repos/adamdriscoll/poshtools/subscription","commits_url":"https://api.github.com/repos/adamdriscoll/poshtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamdriscoll/poshtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamdriscoll/poshtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/comments/{number}","contents_url":"https://api.github.com/repos/adamdriscoll/poshtools/contents/{+path}","compare_url":"https://api.github.com/repos/adamdriscoll/poshtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamdriscoll/poshtools/merges","archive_url":"https://api.github.com/repos/adamdriscoll/poshtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamdriscoll/poshtools/downloads","issues_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues{/number}","pulls_url":"https://api.github.com/repos/adamdriscoll/poshtools/pulls{/number}","milestones_url":"https://api.github.com/repos/adamdriscoll/poshtools/milestones{/number}","notifications_url":"https://api.github.com/repos/adamdriscoll/poshtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamdriscoll/poshtools/labels{/name}","releases_url":"https://api.github.com/repos/adamdriscoll/poshtools/releases{/id}","created_at":"2013-03-05T02:59:17Z","updated_at":"2015-01-17T22:26:17Z","pushed_at":"2015-01-17T22:42:16Z","git_url":"git://github.com/adamdriscoll/poshtools.git","ssh_url":"git@github.com:adamdriscoll/poshtools.git","clone_url":"https://github.com/adamdriscoll/poshtools.git","svn_url":"https://github.com/adamdriscoll/poshtools","homepage":"","size":6713,"stargazers_count":199,"watchers_count":199,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":58,"forks":49,"open_issues":58,"watchers":199,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164"},"html":{"href":"https://github.com/adamdriscoll/poshtools/pull/164"},"issue":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/issues/164"},"comments":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/adamdriscoll/poshtools/statuses/ae73a5e62b3acf07b1ac70ad108f0addd9b399ea"}}}}