Skip to content

Conversation

@daxian-dbw
Copy link
Member

Fix #4001

Summary

When the same script file gets executed in multiple Runspaces, the RuntimeType generated from the powershell class defined in the file will be shared among those Runspaces. For different Runspaces, different SessionState should be used to run the static methods.

Fix

We use the SessionStateKeeper to query for the correct SessionState to use for a static method call.
We already use SessionStateKeeper to track the Runspace/SessionState where a PowerShell class is defined, and thus we can leverage this for the static method invocation.

@daxian-dbw daxian-dbw self-assigned this Jul 10, 2017
@daxian-dbw daxian-dbw requested a review from lzybkr July 10, 2017 18:39
Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daxian-dbw daxian-dbw requested a review from BrucePay July 12, 2017 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants