Ejemplo n.º 1
0
        internal static Runspace[] GetRemoteRunspaces(RunspaceConnectionInfo connectionInfo, PSHost host, TypeTable typeTable)
        {
            List <Runspace> list = new List <Runspace>();

            foreach (System.Management.Automation.Runspaces.RunspacePool pool in RemoteRunspacePoolInternal.GetRemoteRunspacePools(connectionInfo, host, typeTable))
            {
                if (pool.RemoteRunspacePoolInternal.ConnectCommands.Length < 2)
                {
                    list.Add(new RemoteRunspace(pool));
                }
            }
            return(list.ToArray());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Queries the server for disconnected runspace pools and creates an array of runspace
 /// pool objects associated with each disconnected runspace pool on the server.  Each
 /// runspace pool object in the returned array is in the Disconnected state and can be
 /// connected to the server by calling the Connect() method on the runspace pool.
 /// </summary>
 /// <param name="connectionInfo">Connection object for the target server.</param>
 /// <param name="host">Client host object.</param>
 /// <param name="typeTable">TypeTable object.</param>
 /// <returns>Array of RunspacePool objects each in the Disconnected state.</returns>
 public static RunspacePool[] GetRunspacePools(RunspaceConnectionInfo connectionInfo, PSHost host, TypeTable typeTable)
 {
     return(RemoteRunspacePoolInternal.GetRemoteRunspacePools(connectionInfo, host, typeTable));
 }