-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi @PaulHigin,
NamedPipeConnection/src/code/NamedPipeConnection.cs
Lines 567 to 572 in 3fdd736
| _runspace = RunspaceFactory.CreateRunspace( | |
| connectionInfo: _connectionInfo, | |
| host: Host, | |
| typeTable: TypeTable.LoadDefaultTypeFiles(), | |
| applicationArguments: null, | |
| name: Name); |
Here in the createrunspace the cmdlet host is used, however https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.host.pshost?view=powershellsdk-7.2.0#remarks says There is a 1:1 relationship between the instance of the host class and the Runspace instance to which it is passed. In other words, it is not legal to pass the same instance of the host class to more than one call to CreateRunspace. (It is perfectly legal to call CreateRunspace more than once, as long as each call is supplied a unique instance of the host class.)
If you make multiple connections, doesn't this result in the same host instance being used for each remote runspace, thus violating the 1:1 relationship?