{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6939","repository_url":"https://api.github.com/repos/PowerShell/PowerShell","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6939/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6939/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6939/events","html_url":"https://github.com/PowerShell/PowerShell/pull/6939","id":326653547,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNjg3MDg3","number":6939,"title":"Skip compiling the non-supported cmdlets in System.Management.Automation.dll","user":{"login":"daxian-dbw","id":127450,"node_id":"MDQ6VXNlcjEyNzQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/127450?v=4","gravatar_id":"","url":"https://api.github.com/users/daxian-dbw","html_url":"https://github.com/daxian-dbw","followers_url":"https://api.github.com/users/daxian-dbw/followers","following_url":"https://api.github.com/users/daxian-dbw/following{/other_user}","gists_url":"https://api.github.com/users/daxian-dbw/gists{/gist_id}","starred_url":"https://api.github.com/users/daxian-dbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daxian-dbw/subscriptions","organizations_url":"https://api.github.com/users/daxian-dbw/orgs","repos_url":"https://api.github.com/users/daxian-dbw/repos","events_url":"https://api.github.com/users/daxian-dbw/events{/privacy}","received_events_url":"https://api.github.com/users/daxian-dbw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"iSazonov","id":22290914,"node_id":"MDQ6VXNlcjIyMjkwOTE0","avatar_url":"https://avatars2.githubusercontent.com/u/22290914?v=4","gravatar_id":"","url":"https://api.github.com/users/iSazonov","html_url":"https://github.com/iSazonov","followers_url":"https://api.github.com/users/iSazonov/followers","following_url":"https://api.github.com/users/iSazonov/following{/other_user}","gists_url":"https://api.github.com/users/iSazonov/gists{/gist_id}","starred_url":"https://api.github.com/users/iSazonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iSazonov/subscriptions","organizations_url":"https://api.github.com/users/iSazonov/orgs","repos_url":"https://api.github.com/users/iSazonov/repos","events_url":"https://api.github.com/users/iSazonov/events{/privacy}","received_events_url":"https://api.github.com/users/iSazonov/received_events","type":"User","site_admin":false},"assignees":[{"login":"iSazonov","id":22290914,"node_id":"MDQ6VXNlcjIyMjkwOTE0","avatar_url":"https://avatars2.githubusercontent.com/u/22290914?v=4","gravatar_id":"","url":"https://api.github.com/users/iSazonov","html_url":"https://github.com/iSazonov","followers_url":"https://api.github.com/users/iSazonov/followers","following_url":"https://api.github.com/users/iSazonov/following{/other_user}","gists_url":"https://api.github.com/users/iSazonov/gists{/gist_id}","starred_url":"https://api.github.com/users/iSazonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iSazonov/subscriptions","organizations_url":"https://api.github.com/users/iSazonov/orgs","repos_url":"https://api.github.com/users/iSazonov/repos","events_url":"https://api.github.com/users/iSazonov/events{/privacy}","received_events_url":"https://api.github.com/users/iSazonov/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-05-25T20:27:06Z","updated_at":"2018-06-05T18:01:30Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/6939","html_url":"https://github.com/PowerShell/PowerShell/pull/6939","diff_url":"https://github.com/PowerShell/PowerShell/pull/6939.diff","patch_url":"https://github.com/PowerShell/PowerShell/pull/6939.patch"},"body":"## PR Summary\r\n\r\nFix #6886 \r\nOur configuration definition 'Linux' caused our Linux build to be unoptimized, and we didn't realize until recently. This was fixed in #6853, which makes our Linux build adopts the same configuration settings as on Windows -- debug and release.\r\n\r\n`Start-PSBuild -Clean` on Linux starts to use the debug configuration by default, which reveals another issue on Linux build -- we use a cache in `InitialSessionState` to initialize cmdlets from S.M.A.dll in order to speed up powershell startup and items in cache drifts from actual cmdlet types available in S.M.A.dll in Unix platforms.\r\n\r\nThis is because there are some cmdlets not supported on Unix, which are if/def'ed out in the cache code, but they are still compiled in S.M.A.dll on Unix. We have some code that only runs in debug configuration to check if the cache is in sync with the real status of S.M.A.dll, but we never got to run in debug configuration because of the 'Linux' configuration we used before.\r\n\r\nThis PR skips compiling the non-supported cmdlets in S.M.A.dll, to keep the cache in InitialSessionState in sync with the actually available cmdlet types in System.Management.Automation.dll.\r\n\r\n## Change Details\r\n\r\n**Note that** some of the cmdlet source files contain codes that are used in other places outside the cmdlet. Those codes are moved out to `PSRemotingCmdlet.cs`, a more general place where base classes and helper classes for remoting command are located. The following type/methods are moved:\r\n1. Class `QueryRunspaces` and enum `SessionFilterState` from `ConnectPSSession.cs`\r\n2. Class `PSSessionOption` and enum `ProxyAccessType` from `NewPSSessionOptionCommand.cs`\r\n3. Methods `CheckIfPowerShellVersionIsInstalled` and `CheckPSVersion` from `CustomShellCommands.cs` to class `RemotingCommandUtils` in `PSRemotingCmdlet.cs`\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- [ ] [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    - [ ] Not Applicable\r\n    - **OR**\r\n    - [x] User-facing [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)\r\n        - [x] Issue filed - Issue link:\r\n- **Testing - New and feature**\r\n    - [ ] Not Applicable or can only be tested interactively\r\n    - **OR**\r\n    - [ ] [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        - [x] [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"},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments/394804567","html_url":"https://github.com/PowerShell/PowerShell/pull/6939#issuecomment-394804567","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6939","id":394804567,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDgwNDU2Nw==","user":{"login":"daxian-dbw","id":127450,"node_id":"MDQ6VXNlcjEyNzQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/127450?v=4","gravatar_id":"","url":"https://api.github.com/users/daxian-dbw","html_url":"https://github.com/daxian-dbw","followers_url":"https://api.github.com/users/daxian-dbw/followers","following_url":"https://api.github.com/users/daxian-dbw/following{/other_user}","gists_url":"https://api.github.com/users/daxian-dbw/gists{/gist_id}","starred_url":"https://api.github.com/users/daxian-dbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daxian-dbw/subscriptions","organizations_url":"https://api.github.com/users/daxian-dbw/orgs","repos_url":"https://api.github.com/users/daxian-dbw/repos","events_url":"https://api.github.com/users/daxian-dbw/events{/privacy}","received_events_url":"https://api.github.com/users/daxian-dbw/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T18:01:30Z","updated_at":"2018-06-05T18:01:30Z","author_association":"MEMBER","body":"@iSazonov Will fix the build today."}}
{"actor":{"display_login":"daxian-dbw"}}