Title: Fix apartment thread state check on non-Windows platforms. by PaulHigin · Pull Request #11301 · PowerShell/PowerShell · GitHub
Open Graph Title: Fix apartment thread state check on non-Windows platforms. by PaulHigin · Pull Request #11301 · PowerShell/PowerShell
X Title: Fix apartment thread state check on non-Windows platforms. by PaulHigin · Pull Request #11301 · PowerShell/PowerShell
Description: PR Summary This PR removes the apartment thread state check when invoking a script on a PowerShell object for non-Windows platforms. PR Context I found this while testing SSH remoting on non-Windows platforms. Entering into an interactive session on an SSH remote connection between PS6 and PS7 results in an error. The error is due to the apartment thread state check, which should not apply to UNIX platforms. This is a regression. The fix is to simply remove the check since it is not needed for UNIX platforms. # PS 6 on Ubuntu platform making a remote connection to PS 7 on Ubuntu platform. PS > $session = New-PSSession -Host UbuntuPS7 PS > Enter-PSSession $session Enter-PSSession : When the runspace is set to use the current thread, the apartment state in the invocation settings must match that of the current thread. At line:1 char:1 + Enter-PSSession -Session $s + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Enter-PSSession], InvalidOperationException + FullyQualifiedErrorId : RemotePSInvocationStateInfoReason PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready. Breaking changes None OR Experimental feature(s) needed Experimental feature name(s): User-facing changes Not Applicable OR Documentation needed Issue filed: Testing - New and feature N/A or can only be tested interactively OR Make sure you've added a new test if existing tests do not effectively test the code changed Tooling I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. OR I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host). Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions). Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
Open Graph Description: PR Summary This PR removes the apartment thread state check when invoking a script on a PowerShell object for non-Windows platforms. PR Context I found this while testing SSH remoting on non-Window...
X Description: PR Summary This PR removes the apartment thread state check when invoking a script on a PowerShell object for non-Windows platforms. PR Context I found this while testing SSH remoting on non-Window...
Opengraph URL: https://github.com/PowerShell/PowerShell/pull/11301
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:94ea62e5-e270-8946-18fd-9d2dc7b22e2f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D48C:36041B:1A5DA7:23BAD2:6AFD4EBD |
| html-safe-nonce | e933da21fae8484eb50c3822ed8bb9c6ffa65d1e5c3a1e7e12f15327e11cd4a1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDhDOjM2MDQxQjoxQTVEQTc6MjNCQUQyOjZBRkQ0RUJEIiwidmlzaXRvcl9pZCI6IjU4MTQ4MTY2MTA2MTc0NjM2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5c9943ac0df7843b5ff5c0aad8d5e5a84332c3841cefd73fef24737810a63eec |
| hovercard-subject-tag | pull_request:350910674 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/PowerShell/PowerShell/pull/11301/files |
| twitter:image | https://avatars.githubusercontent.com/u/14019529?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14019529?s=400&v=4 |
| og:image:alt | PR Summary This PR removes the apartment thread state check when invoking a script on a PowerShell object for non-Windows platforms. PR Context I found this while testing SSH remoting on non-Window... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width