{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments/44252535","id":44252535,"diff_hunk":"@@ -256,20 +274,33 @@ function Get-ResourcesProperties\n     return $resourcesPropertyBag\n }\n \n-$connection = Get-VssConnection -TaskContext $distributedTaskContext\n+try\n+{\n+  $connection = Get-VssConnection -TaskContext $distributedTaskContext\n \n-Write-Verbose \"Starting Register-Environment cmdlet call for environment : $environmentName with filter $machineFilter\" -Verbose\n-$environment = Register-Environment -EnvironmentName $environmentName -EnvironmentSpecification $environmentName -UserName $adminUserName -Password $adminPassword -WinRmProtocol $protocol -TestCertificate ($testCertificate -eq \"true\") -Connection $connection -TaskContext $distributedTaskContext -ResourceFilter $machineFilter\n-Write-Verbose \"Completed Register-Environment cmdlet call for environment : $environmentName\" -Verbose\n+  Write-Verbose \"Starting Register-Environment cmdlet call for environment : $environmentName with filter $machineFilter\" -Verbose\n+  $environment = Register-Environment -EnvironmentName $environmentName -EnvironmentSpecification $environmentName -UserName $adminUserName -Password $adminPassword -WinRmProtocol $protocol -TestCertificate ($testCertificate -eq \"true\") -Connection $connection -TaskContext $distributedTaskContext -ResourceFilter $machineFilter\n+  Write-Verbose \"Completed Register-Environment cmdlet call for environment : $environmentName\" -Verbose\n \n-Write-Verbose \"Starting Get-EnvironmentResources cmdlet call on environment name: $environmentName\" -Verbose\n-$resources = Get-EnvironmentResources -EnvironmentName $environmentName -TaskContext $distributedTaskContext\n-if ($resources.Count -eq 0)\n-{\n-    throw (Get-LocalizedString -Key \"No machine exists under environment: '{0}' for deployment\" -ArgumentList $environmentName)\n+  Write-Verbose \"Starting Get-EnvironmentResources cmdlet call on environment name: $environmentName\" -Verbose\n+  $resources = Get-EnvironmentResources -EnvironmentName $environmentName -TaskContext $distributedTaskContext\n+  if ($resources.Count -eq 0)\n+  {\n+      Write-Telemetry \"PREREQ002\"\n+      throw (Get-LocalizedString -Key \"No machine exists under environment: '{0}' for deployment\" -ArgumentList $environmentName)\n+  }\n+\n+  $resourcesPropertyBag = Get-ResourcesProperties -resources $resources\n }\n+catch","path":"Tasks/PowerShellOnTargetMachines/PowerShellOnTargetMachines.ps1","position":122,"original_position":122,"commit_id":"88895eaf90e87e896f8d7e36c1de2d35a9f06a11","original_commit_id":"88895eaf90e87e896f8d7e36c1de2d35a9f06a11","user":{"login":"pryenugu","id":11851941,"avatar_url":"https://avatars.githubusercontent.com/u/11851941?v=3","gravatar_id":"","url":"https://api.github.com/users/pryenugu","html_url":"https://github.com/pryenugu","followers_url":"https://api.github.com/users/pryenugu/followers","following_url":"https://api.github.com/users/pryenugu/following{/other_user}","gists_url":"https://api.github.com/users/pryenugu/gists{/gist_id}","starred_url":"https://api.github.com/users/pryenugu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryenugu/subscriptions","organizations_url":"https://api.github.com/users/pryenugu/orgs","repos_url":"https://api.github.com/users/pryenugu/repos","events_url":"https://api.github.com/users/pryenugu/events{/privacy}","received_events_url":"https://api.github.com/users/pryenugu/received_events","type":"User","site_admin":false},"body":"We should not I believe. We will rethrow the exception as it is. Why would we need to add ErrorRecord.FullyQualifiedErrorId? I thought the original exception ill contain it.","created_at":"2015-11-09T09:02:25Z","updated_at":"2015-11-09T09:02:25Z","html_url":"https://github.com/Microsoft/vso-agent-tasks/pull/760#discussion_r44252535","pull_request_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments/44252535"},"html":{"href":"https://github.com/Microsoft/vso-agent-tasks/pull/760#discussion_r44252535"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760","id":49943288,"html_url":"https://github.com/Microsoft/vso-agent-tasks/pull/760","diff_url":"https://github.com/Microsoft/vso-agent-tasks/pull/760.diff","patch_url":"https://github.com/Microsoft/vso-agent-tasks/pull/760.patch","issue_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/760","number":760,"state":"open","locked":false,"title":"Adding basic telemetry to RemotePowerShell Task","user":{"login":"pryenugu","id":11851941,"avatar_url":"https://avatars.githubusercontent.com/u/11851941?v=3","gravatar_id":"","url":"https://api.github.com/users/pryenugu","html_url":"https://github.com/pryenugu","followers_url":"https://api.github.com/users/pryenugu/followers","following_url":"https://api.github.com/users/pryenugu/following{/other_user}","gists_url":"https://api.github.com/users/pryenugu/gists{/gist_id}","starred_url":"https://api.github.com/users/pryenugu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryenugu/subscriptions","organizations_url":"https://api.github.com/users/pryenugu/orgs","repos_url":"https://api.github.com/users/pryenugu/repos","events_url":"https://api.github.com/users/pryenugu/events{/privacy}","received_events_url":"https://api.github.com/users/pryenugu/received_events","type":"User","site_admin":false},"body":"Adding a basic layered-telemetry to RemotePowerShell Task. PREDEP= pre-deployment error; DEP= error during deployment; UNKNOWNPREDEP = Unknown pre-deployment error; PREREQ = Error in prerequisite. This is followed by a numbered code distinguishing error within a category.","created_at":"2015-11-06T11:30:45Z","updated_at":"2015-11-09T09:02:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71808512eba09c3e0c9972cee6db9289df425a5a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/760/comments","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/88895eaf90e87e896f8d7e36c1de2d35a9f06a11","head":{"label":"Microsoft:users/pryenugu/PowerShellOnTargetMahchinesTelemetry","ref":"users/pryenugu/PowerShellOnTargetMahchinesTelemetry","sha":"88895eaf90e87e896f8d7e36c1de2d35a9f06a11","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27631673,"name":"vso-agent-tasks","full_name":"Microsoft/vso-agent-tasks","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent-tasks","description":"Build and Release Tasks for Visual Studio Online and Team Foundation Server","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks","forks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/releases{/id}","created_at":"2014-12-06T11:11:46Z","updated_at":"2015-11-09T07:23:04Z","pushed_at":"2015-11-09T08:18:00Z","git_url":"git://github.com/Microsoft/vso-agent-tasks.git","ssh_url":"git@github.com:Microsoft/vso-agent-tasks.git","clone_url":"https://github.com/Microsoft/vso-agent-tasks.git","svn_url":"https://github.com/Microsoft/vso-agent-tasks","homepage":" https://www.visualstudio.com/features/devops-vs","size":11776,"stargazers_count":147,"watchers_count":147,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":88,"forks":99,"open_issues":88,"watchers":147,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"e21e28c72ce3bfd4ac9d05a8df8c13931460224b","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27631673,"name":"vso-agent-tasks","full_name":"Microsoft/vso-agent-tasks","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent-tasks","description":"Build and Release Tasks for Visual Studio Online and Team Foundation Server","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks","forks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/releases{/id}","created_at":"2014-12-06T11:11:46Z","updated_at":"2015-11-09T07:23:04Z","pushed_at":"2015-11-09T08:18:00Z","git_url":"git://github.com/Microsoft/vso-agent-tasks.git","ssh_url":"git@github.com:Microsoft/vso-agent-tasks.git","clone_url":"https://github.com/Microsoft/vso-agent-tasks.git","svn_url":"https://github.com/Microsoft/vso-agent-tasks","homepage":" https://www.visualstudio.com/features/devops-vs","size":11776,"stargazers_count":147,"watchers_count":147,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":88,"forks":99,"open_issues":88,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760"},"html":{"href":"https://github.com/Microsoft/vso-agent-tasks/pull/760"},"issue":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/760"},"comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/760/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/760/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/88895eaf90e87e896f8d7e36c1de2d35a9f06a11"}}}}