{"action":"created","comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/177957251","pull_request_review_id":107929553,"id":177957251,"diff_hunk":"@@ -743,6 +743,27 @@ private void ProcessCachedGroupOnWide(WideViewHeaderInfo wvhi, List<PacketInfoDa\n             _formattingHint = hint;\n         }\n \n+        static private int GetConsoleWindowWidth(int columnNumber)\n+        {\n+            if (columnNumber == int.MaxValue)\n+            {\n+                // Tables and Wides need to use spaces for padding to maintain table look even if console window is resized.\n+                // For all other output, we use int.MaxValue if the user didn't explicitly specify a width.\n+                // If we detect that int.MaxValue is used, first we try to get the current console window width.\n+                // However, if we can't read that (for example, implicit remoting has no console window), we default\n+                // to something reasonable: 120 columns.\n+                try\n+                {\n+                    return Console.WindowWidth;\n+                }\n+                catch\n+                {\n+                    return 120;","path":"src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs","position":19,"original_position":19,"commit_id":"773cf267542bc18be600b633292ebca8a8879bd6","original_commit_id":"773cf267542bc18be600b633292ebca8a8879bd6","user":{"login":"stknohg","id":720127,"avatar_url":"https://avatars3.githubusercontent.com/u/720127?v=4","gravatar_id":"","url":"https://api.github.com/users/stknohg","html_url":"https://github.com/stknohg","followers_url":"https://api.github.com/users/stknohg/followers","following_url":"https://api.github.com/users/stknohg/following{/other_user}","gists_url":"https://api.github.com/users/stknohg/gists{/gist_id}","starred_url":"https://api.github.com/users/stknohg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stknohg/subscriptions","organizations_url":"https://api.github.com/users/stknohg/orgs","repos_url":"https://api.github.com/users/stknohg/repos","events_url":"https://api.github.com/users/stknohg/events{/privacy}","received_events_url":"https://api.github.com/users/stknohg/received_events","type":"User","site_admin":false},"body":"Hmm...\r\n\r\nIn order to reset the flag, we need to be able to determine if `Console.WindowWidth` can get.  \r\nif we can determine whether we can get `Console.WindowWidth` from the start, we do not need to use `try-catch` statement.\r\n\r\nI am sorry but I have no idea that how to determine if `Console.WindowWidth` can get...\r\n","created_at":"2018-03-29T05:37:05Z","updated_at":"2018-03-29T05:37:05Z","html_url":"https://github.com/PowerShell/PowerShell/pull/6491#discussion_r177957251","pull_request_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/177957251"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/6491#discussion_r177957251"},"pull_request":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491"}},"in_reply_to_id":177811661},"pull_request":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491","id":177260335,"html_url":"https://github.com/PowerShell/PowerShell/pull/6491","diff_url":"https://github.com/PowerShell/PowerShell/pull/6491.diff","patch_url":"https://github.com/PowerShell/PowerShell/pull/6491.patch","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6491","number":6491,"state":"open","locked":false,"title":"Fix error when 'Format-Wide -AutoSize | Out-String' is called.","user":{"login":"stknohg","id":720127,"avatar_url":"https://avatars3.githubusercontent.com/u/720127?v=4","gravatar_id":"","url":"https://api.github.com/users/stknohg","html_url":"https://github.com/stknohg","followers_url":"https://api.github.com/users/stknohg/followers","following_url":"https://api.github.com/users/stknohg/following{/other_user}","gists_url":"https://api.github.com/users/stknohg/gists{/gist_id}","starred_url":"https://api.github.com/users/stknohg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stknohg/subscriptions","organizations_url":"https://api.github.com/users/stknohg/orgs","repos_url":"https://api.github.com/users/stknohg/repos","events_url":"https://api.github.com/users/stknohg/events{/privacy}","received_events_url":"https://api.github.com/users/stknohg/received_events","type":"User","site_admin":false},"body":"## PR Summary\r\n\r\n<!-- summarize your PR between here and the checklist -->\r\nFix #6471.\r\n\r\nThis pull request fixes the error when  `Format-Wide -AutoSize | Out-String` is called.  \r\n\r\nFrom #5193,  `int.MaxValue` is adopted as output width when `Out-String -Width` parameter is not specified.  \r\n`OutCommandInner.TableOutputContext` class is checking output width at initializing.\r\n\r\nhttps://github.com/PowerShell/PowerShell/blob/36b71ba39e36be3b86854b3551ef9f8e2a1de5cc/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs#L923-L939\r\n\r\nThis pull request applies the same method to `OutCommandInner.WideOutputContext` class.\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- [x] [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- [x] 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    - [x] Not Applicable\r\n    - **OR**\r\n    - [ ] User-facing [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)\r\n        - [x] Issue filed - Issue link: #6471\r\n- **Testing - New and feature**\r\n    - [] Not Applicable or can only be tested interactively\r\n    - **OR**\r\n    - [x] [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        - [ ] [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-03-24T21:42:26Z","updated_at":"2018-03-29T05:37:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0a87f698baa9e046830f45bc7858ab1434fe3fe","assignee":{"login":"adityapatwardhan","id":12820925,"avatar_url":"https://avatars0.githubusercontent.com/u/12820925?v=4","gravatar_id":"","url":"https://api.github.com/users/adityapatwardhan","html_url":"https://github.com/adityapatwardhan","followers_url":"https://api.github.com/users/adityapatwardhan/followers","following_url":"https://api.github.com/users/adityapatwardhan/following{/other_user}","gists_url":"https://api.github.com/users/adityapatwardhan/gists{/gist_id}","starred_url":"https://api.github.com/users/adityapatwardhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityapatwardhan/subscriptions","organizations_url":"https://api.github.com/users/adityapatwardhan/orgs","repos_url":"https://api.github.com/users/adityapatwardhan/repos","events_url":"https://api.github.com/users/adityapatwardhan/events{/privacy}","received_events_url":"https://api.github.com/users/adityapatwardhan/received_events","type":"User","site_admin":false},"assignees":[{"login":"adityapatwardhan","id":12820925,"avatar_url":"https://avatars0.githubusercontent.com/u/12820925?v=4","gravatar_id":"","url":"https://api.github.com/users/adityapatwardhan","html_url":"https://github.com/adityapatwardhan","followers_url":"https://api.github.com/users/adityapatwardhan/followers","following_url":"https://api.github.com/users/adityapatwardhan/following{/other_user}","gists_url":"https://api.github.com/users/adityapatwardhan/gists{/gist_id}","starred_url":"https://api.github.com/users/adityapatwardhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityapatwardhan/subscriptions","organizations_url":"https://api.github.com/users/adityapatwardhan/orgs","repos_url":"https://api.github.com/users/adityapatwardhan/repos","events_url":"https://api.github.com/users/adityapatwardhan/events{/privacy}","received_events_url":"https://api.github.com/users/adityapatwardhan/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"JamesWTruher","id":10214008,"avatar_url":"https://avatars2.githubusercontent.com/u/10214008?v=4","gravatar_id":"","url":"https://api.github.com/users/JamesWTruher","html_url":"https://github.com/JamesWTruher","followers_url":"https://api.github.com/users/JamesWTruher/followers","following_url":"https://api.github.com/users/JamesWTruher/following{/other_user}","gists_url":"https://api.github.com/users/JamesWTruher/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesWTruher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesWTruher/subscriptions","organizations_url":"https://api.github.com/users/JamesWTruher/orgs","repos_url":"https://api.github.com/users/JamesWTruher/repos","events_url":"https://api.github.com/users/JamesWTruher/events{/privacy}","received_events_url":"https://api.github.com/users/JamesWTruher/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491/commits","review_comments_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491/comments","review_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6491/comments","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/773cf267542bc18be600b633292ebca8a8879bd6","head":{"label":"stknohg:fix-6471","ref":"fix-6471","sha":"773cf267542bc18be600b633292ebca8a8879bd6","user":{"login":"stknohg","id":720127,"avatar_url":"https://avatars3.githubusercontent.com/u/720127?v=4","gravatar_id":"","url":"https://api.github.com/users/stknohg","html_url":"https://github.com/stknohg","followers_url":"https://api.github.com/users/stknohg/followers","following_url":"https://api.github.com/users/stknohg/following{/other_user}","gists_url":"https://api.github.com/users/stknohg/gists{/gist_id}","starred_url":"https://api.github.com/users/stknohg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stknohg/subscriptions","organizations_url":"https://api.github.com/users/stknohg/orgs","repos_url":"https://api.github.com/users/stknohg/repos","events_url":"https://api.github.com/users/stknohg/events{/privacy}","received_events_url":"https://api.github.com/users/stknohg/received_events","type":"User","site_admin":false},"repo":{"id":86915678,"name":"PowerShell","full_name":"stknohg/PowerShell","owner":{"login":"stknohg","id":720127,"avatar_url":"https://avatars3.githubusercontent.com/u/720127?v=4","gravatar_id":"","url":"https://api.github.com/users/stknohg","html_url":"https://github.com/stknohg","followers_url":"https://api.github.com/users/stknohg/followers","following_url":"https://api.github.com/users/stknohg/following{/other_user}","gists_url":"https://api.github.com/users/stknohg/gists{/gist_id}","starred_url":"https://api.github.com/users/stknohg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stknohg/subscriptions","organizations_url":"https://api.github.com/users/stknohg/orgs","repos_url":"https://api.github.com/users/stknohg/repos","events_url":"https://api.github.com/users/stknohg/events{/privacy}","received_events_url":"https://api.github.com/users/stknohg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stknohg/PowerShell","description":"PowerShell for every system!","fork":true,"url":"https://api.github.com/repos/stknohg/PowerShell","forks_url":"https://api.github.com/repos/stknohg/PowerShell/forks","keys_url":"https://api.github.com/repos/stknohg/PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stknohg/PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stknohg/PowerShell/teams","hooks_url":"https://api.github.com/repos/stknohg/PowerShell/hooks","issue_events_url":"https://api.github.com/repos/stknohg/PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/stknohg/PowerShell/events","assignees_url":"https://api.github.com/repos/stknohg/PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/stknohg/PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/stknohg/PowerShell/tags","blobs_url":"https://api.github.com/repos/stknohg/PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stknohg/PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stknohg/PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/stknohg/PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stknohg/PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/stknohg/PowerShell/languages","stargazers_url":"https://api.github.com/repos/stknohg/PowerShell/stargazers","contributors_url":"https://api.github.com/repos/stknohg/PowerShell/contributors","subscribers_url":"https://api.github.com/repos/stknohg/PowerShell/subscribers","subscription_url":"https://api.github.com/repos/stknohg/PowerShell/subscription","commits_url":"https://api.github.com/repos/stknohg/PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/stknohg/PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/stknohg/PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/stknohg/PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/stknohg/PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/stknohg/PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stknohg/PowerShell/merges","archive_url":"https://api.github.com/repos/stknohg/PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stknohg/PowerShell/downloads","issues_url":"https://api.github.com/repos/stknohg/PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/stknohg/PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/stknohg/PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/stknohg/PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stknohg/PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/stknohg/PowerShell/releases{/id}","deployments_url":"https://api.github.com/repos/stknohg/PowerShell/deployments","created_at":"2017-04-01T13:35:44Z","updated_at":"2018-03-27T09:17:50Z","pushed_at":"2018-03-28T14:36:46Z","git_url":"git://github.com/stknohg/PowerShell.git","ssh_url":"git@github.com:stknohg/PowerShell.git","clone_url":"https://github.com/stknohg/PowerShell.git","svn_url":"https://github.com/stknohg/PowerShell","homepage":"https://microsoft.com/powershell","size":35194,"stargazers_count":0,"watchers_count":0,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"PowerShell:master","ref":"master","sha":"e86fea6acd508297646e307ffeae2340d0bafaa8","user":{"login":"PowerShell","id":11524380,"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,"name":"PowerShell","full_name":"PowerShell/PowerShell","owner":{"login":"PowerShell","id":11524380,"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-03-29T05:36:32Z","pushed_at":"2018-03-29T04:08:24Z","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":36160,"stargazers_count":9843,"watchers_count":9843,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1493,"mirror_url":null,"archived":false,"open_issues_count":1366,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1493,"open_issues":1366,"watchers":9843,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/6491"},"issue":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/6491"},"comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/6491/comments"},"review_comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491/comments"},"review_comment":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6491/commits"},"statuses":{"href":"https://api.github.com/repos/PowerShell/PowerShell/statuses/773cf267542bc18be600b633292ebca8a8879bd6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stknohg"}}