internal override AbstractServerTransportManager GetCommandTransportManager(Guid powerShellCmdId) { if (_transportManagers.ContainsKey(powerShellCmdId)) { return(_transportManagers[powerShellCmdId]); } var manager = new WSManServerTransportManager(powerShellCmdId, _writer); manager.MigrateDataReadyEventHandlers(this); _transportManagers.Add(powerShellCmdId, manager); return(manager); }
public byte[] ReceiveData(Guid sessionId, Guid powerShellCmdId) { ServerRemoteSession session; if (_sessions.TryGetValue(sessionId, out session)) { if (powerShellCmdId == Guid.Empty) { WSManServerSessionTransportManager transport = (WSManServerSessionTransportManager)session.SessionDataStructureHandler.TransportManager; return(transport.GetBuffer()); } else { WSManServerTransportManager manager = (WSManServerTransportManager)session.SessionDataStructureHandler.TransportManager.GetCommandTransportManager(powerShellCmdId); return(manager.GetBuffer()); } } return(new byte[0]); }