FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix apartment thread state check on non-Windows platforms. by PaulHigin · Pull Request #11301 · PowerShell/PowerShell · GitHub

Fix apartment thread state check on non-Windows platforms. - #11301

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
PaulHigin:fix-non-windows-apartmentstate-check
Dec 10, 2019
Merged

Fix apartment thread state check on non-Windows platforms.#11301
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
PaulHigin:fix-non-windows-apartmentstate-check

Conversation

Copy link
Copy Markdown
Contributor

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

Dongbo Wang (daxian-dbw) merged commit c232903 into PowerShell:master Dec 10, 2019
Paul Higinbotham (PaulHigin) deleted the fix-non-windows-apartmentstate-check branch December 10, 2019 15:38
Dongbo Wang (daxian-dbw) added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Dec 14, 2019

Copy link
Copy Markdown

🎉v7.0.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL