{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments/35594583","id":35594583,"diff_hunk":"@@ -345,5 +346,44 @@ private void AddEventHandlers()\n             _runspace.StateChanged += _runspace_StateChanged;\r\n             _runspace.AvailabilityChanged += _runspace_AvailabilityChanged;\r\n         }\r\n+\r\n+        /// <summary>\r\n+        /// Invokes given script on the provided PowerShell object after setting its runspace object.\r\n+        /// </summary>\r\n+        /// <param name=\"powerShell\">This should usually be _currentPowerShell. Make sure to enclose uses of _currentPowerShell and this method\r\n+        /// inside of a using. </param>\r\n+        /// <param name=\"script\">Script to invoke.</param>\r\n+        /// <returns>Returns the result of the invoke</returns>\r\n+        private Collection<PSObject> InvokeScript(PowerShell powerShell, string script)\r\n+        {\r\n+            powerShell.Commands.Clear();\r\n+            powerShell.Runspace = _runspace;\r\n+            powerShell.AddScript(script);\r\n+            return powerShell.Invoke();\r\n+        }\r\n+\r\n+        /// <summary>\r\n+        /// Uses _savedCredential in order to enter into a remote session with a remote machine. If _savedCredential is null, method will instead\r\n+        /// use InvokeScript to prompt/enter into a session without saving credentials.\r\n+        /// </summary>\r\n+        /// <param name=\"powerShell\">This should usually be _currentPowerShell. Make sure to enclose uses of _currentPowerShell and this method\r\n+        /// inside of a using. </param>\r\n+        /// <param name=\"remoteName\">Machine to connect to.</param>\r\n+        private void EnterCredentialedRemoteSession(PowerShell powerShell, string remoteName)\r\n+        {\r\n+            if (_savedCredential == null)\r\n+            {\r\n+                InvokeScript(_currentPowerShell, string.Format(DebugEngineConstants.EnterRemoteSessionDefaultCommand, remoteName));\r","path":"PowerShellTools.HostService/ServiceManagement/Debugging/PowershellDebuggingServiceUtilities.cs","position":39,"original_position":39,"commit_id":"55eaa60cedb3576f1a8370794fbfdc32f2e6c000","original_commit_id":"55eaa60cedb3576f1a8370794fbfdc32f2e6c000","user":{"login":"EricMSFT","id":10081101,"avatar_url":"https://avatars.githubusercontent.com/u/10081101?v=3","gravatar_id":"","url":"https://api.github.com/users/EricMSFT","html_url":"https://github.com/EricMSFT","followers_url":"https://api.github.com/users/EricMSFT/followers","following_url":"https://api.github.com/users/EricMSFT/following{/other_user}","gists_url":"https://api.github.com/users/EricMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/EricMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricMSFT/subscriptions","organizations_url":"https://api.github.com/users/EricMSFT/orgs","repos_url":"https://api.github.com/users/EricMSFT/repos","events_url":"https://api.github.com/users/EricMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/EricMSFT/received_events","type":"User","site_admin":false},"body":"Use powershell?","created_at":"2015-07-27T22:20:55Z","updated_at":"2015-07-27T22:20:55Z","html_url":"https://github.com/Microsoft/poshtools/pull/669#discussion_r35594583","pull_request_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/669","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments/35594583"},"html":{"href":"https://github.com/Microsoft/poshtools/pull/669#discussion_r35594583"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/669"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/poshtools/pulls/669","id":40731954,"html_url":"https://github.com/Microsoft/poshtools/pull/669","diff_url":"https://github.com/Microsoft/poshtools/pull/669.diff","patch_url":"https://github.com/Microsoft/poshtools/pull/669.patch","issue_url":"https://api.github.com/repos/Microsoft/poshtools/issues/669","number":669,"state":"open","locked":false,"title":"Remote Debugging - Tests and Bug Bash Fixes","user":{"login":"MrayerMSFT","id":12631548,"avatar_url":"https://avatars.githubusercontent.com/u/12631548?v=3","gravatar_id":"","url":"https://api.github.com/users/MrayerMSFT","html_url":"https://github.com/MrayerMSFT","followers_url":"https://api.github.com/users/MrayerMSFT/followers","following_url":"https://api.github.com/users/MrayerMSFT/following{/other_user}","gists_url":"https://api.github.com/users/MrayerMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/MrayerMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrayerMSFT/subscriptions","organizations_url":"https://api.github.com/users/MrayerMSFT/orgs","repos_url":"https://api.github.com/users/MrayerMSFT/repos","events_url":"https://api.github.com/users/MrayerMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/MrayerMSFT/received_events","type":"User","site_admin":false},"body":"Pull request includes a variety of things:\r\n\r\n1. Refactoring of the attaching/detaching verification into a stand alone class which is testable.\r\n2. Tests for said class.\r\n3. Fix of call stack regex. (#656)\r\n4. Additional error handling and cleanup of the runspace/host service/etc. after bad situations. (#658, #660, #665)\r\n5. Code to prevent users from attaching both locally and remotely if they are already attached to something. (#662)\r\n6. Update to the remote transport description (#659), please provide feedback on this! This wording determines whether or not people correctly use the feature the first time.\r\n7. When the user enters their credentials in the attach window for remote debugging, we now save those credentials for use if they hit attach. (#650)\r\n\r\n@HuanhuanSunMSFT @AndreSayreMSFT @EricMSFT @jinglou- \r\n","created_at":"2015-07-24T00:14:10Z","updated_at":"2015-07-27T22:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c523b68218e15639c115bfe1739f6b5f15ec968f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/669/commits","review_comments_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/669/comments","review_comment_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/poshtools/issues/669/comments","statuses_url":"https://api.github.com/repos/Microsoft/poshtools/statuses/55eaa60cedb3576f1a8370794fbfdc32f2e6c000","head":{"label":"Microsoft:remotedbg-tests","ref":"remotedbg-tests","sha":"55eaa60cedb3576f1a8370794fbfdc32f2e6c000","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":27854486,"name":"poshtools","full_name":"Microsoft/poshtools","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/poshtools","description":"PowerShell integration for Visual Studio","fork":true,"url":"https://api.github.com/repos/Microsoft/poshtools","forks_url":"https://api.github.com/repos/Microsoft/poshtools/forks","keys_url":"https://api.github.com/repos/Microsoft/poshtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/poshtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/poshtools/teams","hooks_url":"https://api.github.com/repos/Microsoft/poshtools/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/poshtools/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/poshtools/events","assignees_url":"https://api.github.com/repos/Microsoft/poshtools/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/poshtools/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/poshtools/tags","blobs_url":"https://api.github.com/repos/Microsoft/poshtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/poshtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/poshtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/poshtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/poshtools/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/poshtools/languages","stargazers_url":"https://api.github.com/repos/Microsoft/poshtools/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/poshtools/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/poshtools/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/poshtools/subscription","commits_url":"https://api.github.com/repos/Microsoft/poshtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/poshtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/poshtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/poshtools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/poshtools/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/poshtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/poshtools/merges","archive_url":"https://api.github.com/repos/Microsoft/poshtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/poshtools/downloads","issues_url":"https://api.github.com/repos/Microsoft/poshtools/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/poshtools/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/poshtools/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/poshtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/poshtools/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/poshtools/releases{/id}","created_at":"2014-12-11T04:44:03Z","updated_at":"2015-07-24T10:41:06Z","pushed_at":"2015-07-27T20:47:35Z","git_url":"git://github.com/Microsoft/poshtools.git","ssh_url":"git@github.com:Microsoft/poshtools.git","clone_url":"https://github.com/Microsoft/poshtools.git","svn_url":"https://github.com/Microsoft/poshtools","homepage":"http://www.visualstudio.com/","size":12484,"stargazers_count":110,"watchers_count":110,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":159,"forks":12,"open_issues":159,"watchers":110,"default_branch":"dev"}},"base":{"label":"Microsoft:dev","ref":"dev","sha":"b6ebc44353bcacc81ce7c30438e747f0a18eaf5e","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":27854486,"name":"poshtools","full_name":"Microsoft/poshtools","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/poshtools","description":"PowerShell integration for Visual Studio","fork":true,"url":"https://api.github.com/repos/Microsoft/poshtools","forks_url":"https://api.github.com/repos/Microsoft/poshtools/forks","keys_url":"https://api.github.com/repos/Microsoft/poshtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/poshtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/poshtools/teams","hooks_url":"https://api.github.com/repos/Microsoft/poshtools/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/poshtools/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/poshtools/events","assignees_url":"https://api.github.com/repos/Microsoft/poshtools/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/poshtools/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/poshtools/tags","blobs_url":"https://api.github.com/repos/Microsoft/poshtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/poshtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/poshtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/poshtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/poshtools/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/poshtools/languages","stargazers_url":"https://api.github.com/repos/Microsoft/poshtools/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/poshtools/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/poshtools/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/poshtools/subscription","commits_url":"https://api.github.com/repos/Microsoft/poshtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/poshtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/poshtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/poshtools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/poshtools/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/poshtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/poshtools/merges","archive_url":"https://api.github.com/repos/Microsoft/poshtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/poshtools/downloads","issues_url":"https://api.github.com/repos/Microsoft/poshtools/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/poshtools/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/poshtools/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/poshtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/poshtools/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/poshtools/releases{/id}","created_at":"2014-12-11T04:44:03Z","updated_at":"2015-07-24T10:41:06Z","pushed_at":"2015-07-27T20:47:35Z","git_url":"git://github.com/Microsoft/poshtools.git","ssh_url":"git@github.com:Microsoft/poshtools.git","clone_url":"https://github.com/Microsoft/poshtools.git","svn_url":"https://github.com/Microsoft/poshtools","homepage":"http://www.visualstudio.com/","size":12484,"stargazers_count":110,"watchers_count":110,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":159,"forks":12,"open_issues":159,"watchers":110,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/669"},"html":{"href":"https://github.com/Microsoft/poshtools/pull/669"},"issue":{"href":"https://api.github.com/repos/Microsoft/poshtools/issues/669"},"comments":{"href":"https://api.github.com/repos/Microsoft/poshtools/issues/669/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/669/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/669/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/poshtools/statuses/55eaa60cedb3576f1a8370794fbfdc32f2e6c000"}}}}