SessionStateKeeper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Every Runspace in one process contains SessionStateInternal per module (module SessionState). Every RuntimeType is associated to only one SessionState in the Runspace, which creates it: it's either global state or a module state. In the former case, module can be imported from the different runspaces in the same process. And so runspaces will share RuntimeType. But in every runspace, Type is associated with just one SessionState. We want type methods to be able access $script: variables and module-specific methods. To achieve it, we preserve reference to SessionState that creates type in the private field 'SessionStateFieldName'. Later, we use it to call scriptBlocks captured in ScriptBlockMemberMethodWrapper with the right sessionState.
public ref class SessionStateKeeper
public class SessionStateKeeper
type SessionStateKeeper = class
Public Class SessionStateKeeper
- Inheritance
-
SessionStateKeeper
Methods
GetSessionState() |
This method should be called only from
|