/// <summary> /// Initialize the pool and populate it with PowerShellManager instances. /// We instantiate PowerShellManager instances in a lazy way, starting from size 1 and increase the number of workers as needed. /// </summary> internal void Initialize(string requestId) { var logger = new RpcLogger(_msgStream); try { logger.SetContext(requestId, invocationId: null); _pool.Add(new PowerShellManager(logger)); _poolSize = 1; } finally { logger.ResetContext(); } }