{"action":"created","comment":{"url":"https://api.github.com/repos/OneGet/oneget/pulls/comments/78659076","id":78659076,"diff_hunk":"@@ -478,15 +478,34 @@ protected virtual IHostApi PackageManagementHost\n         //Calling PowerShell Telemetry APIs\r\n         protected void TraceMessage(string message, SoftwareIdentity swidObject) {\r\n #if !UNIX\r\n-            TelemetryAPI.TraceMessage(message,\r\n-                new {\r\n+            try\r\n+            {\r\n+                // try to load telemetry api from sma\r\n+                // we have to check for telemetry type instead of just running try catch because if telemetryapi cannot be loaded, the error\r\n+                // will not be caught in this try catch\r\n+                Assembly sma = typeof(Cmdlet).GetTypeInfo().Assembly;\r\n+\r\n+                // this will throw if type is not found\r\n+                Type telemetryApi = sma.GetType(\"Microsoft.PowerShell.Telemetry.Internal.TelemetryAPI\", true);\r","path":"src/Microsoft.PowerShell.PackageManagement/Cmdlets/CmdletBase.cs","position":23,"original_position":23,"commit_id":"03636b5c0336d5ccaf398c33b84d2841bdedb701","original_commit_id":"03636b5c0336d5ccaf398c33b84d2841bdedb701","user":{"login":"bmanikm","id":5000058,"avatar_url":"https://avatars.githubusercontent.com/u/5000058?v=3","gravatar_id":"","url":"https://api.github.com/users/bmanikm","html_url":"https://github.com/bmanikm","followers_url":"https://api.github.com/users/bmanikm/followers","following_url":"https://api.github.com/users/bmanikm/following{/other_user}","gists_url":"https://api.github.com/users/bmanikm/gists{/gist_id}","starred_url":"https://api.github.com/users/bmanikm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmanikm/subscriptions","organizations_url":"https://api.github.com/users/bmanikm/orgs","repos_url":"https://api.github.com/users/bmanikm/repos","events_url":"https://api.github.com/users/bmanikm/events{/privacy}","received_events_url":"https://api.github.com/users/bmanikm/received_events","type":"User","site_admin":false},"body":"Won't this impact the perf? you are calling this for every TraceMessage call?","created_at":"2016-09-13T22:47:38Z","updated_at":"2016-09-13T22:47:38Z","html_url":"https://github.com/OneGet/oneget/pull/210#discussion_r78659076","pull_request_url":"https://api.github.com/repos/OneGet/oneget/pulls/210","_links":{"self":{"href":"https://api.github.com/repos/OneGet/oneget/pulls/comments/78659076"},"html":{"href":"https://github.com/OneGet/oneget/pull/210#discussion_r78659076"},"pull_request":{"href":"https://api.github.com/repos/OneGet/oneget/pulls/210"}}},"pull_request":{"url":"https://api.github.com/repos/OneGet/oneget/pulls/210","id":85122270,"html_url":"https://github.com/OneGet/oneget/pull/210","diff_url":"https://github.com/OneGet/oneget/pull/210.diff","patch_url":"https://github.com/OneGet/oneget/pull/210.patch","issue_url":"https://api.github.com/repos/OneGet/oneget/issues/210","number":210,"state":"open","locked":false,"title":"Add try catch for telemetry api so it won't fail on machine without wmf5 ","user":{"login":"quoctruong","id":4371645,"avatar_url":"https://avatars.githubusercontent.com/u/4371645?v=3","gravatar_id":"","url":"https://api.github.com/users/quoctruong","html_url":"https://github.com/quoctruong","followers_url":"https://api.github.com/users/quoctruong/followers","following_url":"https://api.github.com/users/quoctruong/following{/other_user}","gists_url":"https://api.github.com/users/quoctruong/gists{/gist_id}","starred_url":"https://api.github.com/users/quoctruong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quoctruong/subscriptions","organizations_url":"https://api.github.com/users/quoctruong/orgs","repos_url":"https://api.github.com/users/quoctruong/repos","events_url":"https://api.github.com/users/quoctruong/events{/privacy}","received_events_url":"https://api.github.com/users/quoctruong/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-13T20:47:40Z","updated_at":"2016-09-13T22:47:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48a0035508f9b13788d64f4c9d3c9de93de01c0e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OneGet/oneget/pulls/210/commits","review_comments_url":"https://api.github.com/repos/OneGet/oneget/pulls/210/comments","review_comment_url":"https://api.github.com/repos/OneGet/oneget/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OneGet/oneget/issues/210/comments","statuses_url":"https://api.github.com/repos/OneGet/oneget/statuses/03636b5c0336d5ccaf398c33b84d2841bdedb701","head":{"label":"OneGet:fixtelemetryapi","ref":"fixtelemetryapi","sha":"03636b5c0336d5ccaf398c33b84d2841bdedb701","user":{"login":"OneGet","id":7153805,"avatar_url":"https://avatars.githubusercontent.com/u/7153805?v=3","gravatar_id":"","url":"https://api.github.com/users/OneGet","html_url":"https://github.com/OneGet","followers_url":"https://api.github.com/users/OneGet/followers","following_url":"https://api.github.com/users/OneGet/following{/other_user}","gists_url":"https://api.github.com/users/OneGet/gists{/gist_id}","starred_url":"https://api.github.com/users/OneGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OneGet/subscriptions","organizations_url":"https://api.github.com/users/OneGet/orgs","repos_url":"https://api.github.com/users/OneGet/repos","events_url":"https://api.github.com/users/OneGet/events{/privacy}","received_events_url":"https://api.github.com/users/OneGet/received_events","type":"Organization","site_admin":false},"repo":{"id":18418026,"name":"oneget","full_name":"OneGet/oneget","owner":{"login":"OneGet","id":7153805,"avatar_url":"https://avatars.githubusercontent.com/u/7153805?v=3","gravatar_id":"","url":"https://api.github.com/users/OneGet","html_url":"https://github.com/OneGet","followers_url":"https://api.github.com/users/OneGet/followers","following_url":"https://api.github.com/users/OneGet/following{/other_user}","gists_url":"https://api.github.com/users/OneGet/gists{/gist_id}","starred_url":"https://api.github.com/users/OneGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OneGet/subscriptions","organizations_url":"https://api.github.com/users/OneGet/orgs","repos_url":"https://api.github.com/users/OneGet/repos","events_url":"https://api.github.com/users/OneGet/events{/privacy}","received_events_url":"https://api.github.com/users/OneGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OneGet/oneget","description":"PackageManagement (aka OneGet) is a package manager for Windows","fork":false,"url":"https://api.github.com/repos/OneGet/oneget","forks_url":"https://api.github.com/repos/OneGet/oneget/forks","keys_url":"https://api.github.com/repos/OneGet/oneget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OneGet/oneget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OneGet/oneget/teams","hooks_url":"https://api.github.com/repos/OneGet/oneget/hooks","issue_events_url":"https://api.github.com/repos/OneGet/oneget/issues/events{/number}","events_url":"https://api.github.com/repos/OneGet/oneget/events","assignees_url":"https://api.github.com/repos/OneGet/oneget/assignees{/user}","branches_url":"https://api.github.com/repos/OneGet/oneget/branches{/branch}","tags_url":"https://api.github.com/repos/OneGet/oneget/tags","blobs_url":"https://api.github.com/repos/OneGet/oneget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OneGet/oneget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OneGet/oneget/git/refs{/sha}","trees_url":"https://api.github.com/repos/OneGet/oneget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OneGet/oneget/statuses/{sha}","languages_url":"https://api.github.com/repos/OneGet/oneget/languages","stargazers_url":"https://api.github.com/repos/OneGet/oneget/stargazers","contributors_url":"https://api.github.com/repos/OneGet/oneget/contributors","subscribers_url":"https://api.github.com/repos/OneGet/oneget/subscribers","subscription_url":"https://api.github.com/repos/OneGet/oneget/subscription","commits_url":"https://api.github.com/repos/OneGet/oneget/commits{/sha}","git_commits_url":"https://api.github.com/repos/OneGet/oneget/git/commits{/sha}","comments_url":"https://api.github.com/repos/OneGet/oneget/comments{/number}","issue_comment_url":"https://api.github.com/repos/OneGet/oneget/issues/comments{/number}","contents_url":"https://api.github.com/repos/OneGet/oneget/contents/{+path}","compare_url":"https://api.github.com/repos/OneGet/oneget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OneGet/oneget/merges","archive_url":"https://api.github.com/repos/OneGet/oneget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OneGet/oneget/downloads","issues_url":"https://api.github.com/repos/OneGet/oneget/issues{/number}","pulls_url":"https://api.github.com/repos/OneGet/oneget/pulls{/number}","milestones_url":"https://api.github.com/repos/OneGet/oneget/milestones{/number}","notifications_url":"https://api.github.com/repos/OneGet/oneget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OneGet/oneget/labels{/name}","releases_url":"https://api.github.com/repos/OneGet/oneget/releases{/id}","deployments_url":"https://api.github.com/repos/OneGet/oneget/deployments","created_at":"2014-04-03T20:57:40Z","updated_at":"2016-09-13T04:57:36Z","pushed_at":"2016-09-13T21:51:44Z","git_url":"git://github.com/OneGet/oneget.git","ssh_url":"git@github.com:OneGet/oneget.git","clone_url":"https://github.com/OneGet/oneget.git","svn_url":"https://github.com/OneGet/oneget","homepage":"","size":5911,"stargazers_count":1322,"watchers_count":1322,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":33,"forks":74,"open_issues":33,"watchers":1322,"default_branch":"master"}},"base":{"label":"OneGet:master","ref":"master","sha":"29bc605f0449557596df647f031f875d93b83b55","user":{"login":"OneGet","id":7153805,"avatar_url":"https://avatars.githubusercontent.com/u/7153805?v=3","gravatar_id":"","url":"https://api.github.com/users/OneGet","html_url":"https://github.com/OneGet","followers_url":"https://api.github.com/users/OneGet/followers","following_url":"https://api.github.com/users/OneGet/following{/other_user}","gists_url":"https://api.github.com/users/OneGet/gists{/gist_id}","starred_url":"https://api.github.com/users/OneGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OneGet/subscriptions","organizations_url":"https://api.github.com/users/OneGet/orgs","repos_url":"https://api.github.com/users/OneGet/repos","events_url":"https://api.github.com/users/OneGet/events{/privacy}","received_events_url":"https://api.github.com/users/OneGet/received_events","type":"Organization","site_admin":false},"repo":{"id":18418026,"name":"oneget","full_name":"OneGet/oneget","owner":{"login":"OneGet","id":7153805,"avatar_url":"https://avatars.githubusercontent.com/u/7153805?v=3","gravatar_id":"","url":"https://api.github.com/users/OneGet","html_url":"https://github.com/OneGet","followers_url":"https://api.github.com/users/OneGet/followers","following_url":"https://api.github.com/users/OneGet/following{/other_user}","gists_url":"https://api.github.com/users/OneGet/gists{/gist_id}","starred_url":"https://api.github.com/users/OneGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OneGet/subscriptions","organizations_url":"https://api.github.com/users/OneGet/orgs","repos_url":"https://api.github.com/users/OneGet/repos","events_url":"https://api.github.com/users/OneGet/events{/privacy}","received_events_url":"https://api.github.com/users/OneGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OneGet/oneget","description":"PackageManagement (aka OneGet) is a package manager for Windows","fork":false,"url":"https://api.github.com/repos/OneGet/oneget","forks_url":"https://api.github.com/repos/OneGet/oneget/forks","keys_url":"https://api.github.com/repos/OneGet/oneget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OneGet/oneget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OneGet/oneget/teams","hooks_url":"https://api.github.com/repos/OneGet/oneget/hooks","issue_events_url":"https://api.github.com/repos/OneGet/oneget/issues/events{/number}","events_url":"https://api.github.com/repos/OneGet/oneget/events","assignees_url":"https://api.github.com/repos/OneGet/oneget/assignees{/user}","branches_url":"https://api.github.com/repos/OneGet/oneget/branches{/branch}","tags_url":"https://api.github.com/repos/OneGet/oneget/tags","blobs_url":"https://api.github.com/repos/OneGet/oneget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OneGet/oneget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OneGet/oneget/git/refs{/sha}","trees_url":"https://api.github.com/repos/OneGet/oneget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OneGet/oneget/statuses/{sha}","languages_url":"https://api.github.com/repos/OneGet/oneget/languages","stargazers_url":"https://api.github.com/repos/OneGet/oneget/stargazers","contributors_url":"https://api.github.com/repos/OneGet/oneget/contributors","subscribers_url":"https://api.github.com/repos/OneGet/oneget/subscribers","subscription_url":"https://api.github.com/repos/OneGet/oneget/subscription","commits_url":"https://api.github.com/repos/OneGet/oneget/commits{/sha}","git_commits_url":"https://api.github.com/repos/OneGet/oneget/git/commits{/sha}","comments_url":"https://api.github.com/repos/OneGet/oneget/comments{/number}","issue_comment_url":"https://api.github.com/repos/OneGet/oneget/issues/comments{/number}","contents_url":"https://api.github.com/repos/OneGet/oneget/contents/{+path}","compare_url":"https://api.github.com/repos/OneGet/oneget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OneGet/oneget/merges","archive_url":"https://api.github.com/repos/OneGet/oneget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OneGet/oneget/downloads","issues_url":"https://api.github.com/repos/OneGet/oneget/issues{/number}","pulls_url":"https://api.github.com/repos/OneGet/oneget/pulls{/number}","milestones_url":"https://api.github.com/repos/OneGet/oneget/milestones{/number}","notifications_url":"https://api.github.com/repos/OneGet/oneget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OneGet/oneget/labels{/name}","releases_url":"https://api.github.com/repos/OneGet/oneget/releases{/id}","deployments_url":"https://api.github.com/repos/OneGet/oneget/deployments","created_at":"2014-04-03T20:57:40Z","updated_at":"2016-09-13T04:57:36Z","pushed_at":"2016-09-13T21:51:44Z","git_url":"git://github.com/OneGet/oneget.git","ssh_url":"git@github.com:OneGet/oneget.git","clone_url":"https://github.com/OneGet/oneget.git","svn_url":"https://github.com/OneGet/oneget","homepage":"","size":5911,"stargazers_count":1322,"watchers_count":1322,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":33,"forks":74,"open_issues":33,"watchers":1322,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OneGet/oneget/pulls/210"},"html":{"href":"https://github.com/OneGet/oneget/pull/210"},"issue":{"href":"https://api.github.com/repos/OneGet/oneget/issues/210"},"comments":{"href":"https://api.github.com/repos/OneGet/oneget/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/OneGet/oneget/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/OneGet/oneget/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OneGet/oneget/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/OneGet/oneget/statuses/03636b5c0336d5ccaf398c33b84d2841bdedb701"}}}}
{"actor":{"display_login":"bmanikm"}}