(self, connection, apartment_state=ApartmentState.UNKNOWN,
                 thread_options=PSThreadOptions.DEFAULT, host=None,
                 configuration_name=DEFAULT_CONFIGURATION_NAME, min_runspaces=1,
                 max_runspaces=1, session_key_timeout_ms=60000)
Represents a Runspace pool on a remote host. This pool can contain
        one or more running PowerShell instances.

        This is meant to be a near representation of the
        System.Management.Automation.Runspaces.RunspacePool .NET class

        :param connection: The connection object used to send the command over
            to the remote host. Right now only pypsrp.wsman.WSMan is supported
        :param apartment_state: The ApartmentState enum int values that specify
            the apartment state of the remote thread
        :param thread_options: The ThreadOptions enum int values that specify
            what type of thread of create
        :param host: An implementation of pypsrp.host.PSHost that defines
            the current host and what it supports
        :param configuration_name: The PSRP configuration name to connect to,
            by default this is Microsoft.PowerShell which opens a full
            PowerShell endpoint, use this to specify the JEA configuration to
            connect to
        :param min_runspaces: The minimum number of runspaces that a pool can
            hold
        :param max_runspaces: The maximum number of runspaces that a pool can
            hold
        :param session_key_timeout_ms: The maximum time to wait for a session
            key transfer from the server
Represents a Runspace pool on a remote host. This pool can contain
        one or more running PowerShell instances.
Represents a Runspace pool on a remote host . This pool can contain one or more running PowerShell instances .
def __init__(self, connection, apartment_state=ApartmentState.UNKNOWN,
                 thread_options=PSThreadOptions.DEFAULT, host=None,
                 configuration_name=DEFAULT_CONFIGURATION_NAME, min_runspaces=1,
                 max_runspaces=1, session_key_timeout_ms=60000):
        """
        Represents a Runspace pool on a remote host. This pool can contain
        one or more running PowerShell instances.

        This is meant to be a near representation of the
        System.Management.Automation.Runspaces.RunspacePool .NET class

        :param connection: The connection object used to send the command over
            to the remote host. Right now only pypsrp.wsman.WSMan is supported
        :param apartment_state: The ApartmentState enum int values that specify
            the apartment state of the remote thread
        :param thread_options: The ThreadOptions enum int values that specify
            what type of thread of create
        :param host: An implementation of pypsrp.host.PSHost that defines
            the current host and what it supports
        :param configuration_name: The PSRP configuration name to connect to,
            by default this is Microsoft.PowerShell which opens a full
            PowerShell endpoint, use this to specify the JEA configuration to
            connect to
        :param min_runspaces: The minimum number of runspaces that a pool can
            hold
        :param max_runspaces: The maximum number of runspaces that a pool can
            hold
        :param session_key_timeout_ms: The maximum time to wait for a session
            key transfer from the server
        """
        log.info("Initialising RunspacePool object for configuration %s"
                 % configuration_name)
        # The below are defined in some way at
        # https://msdn.microsoft.com/en-us/library/ee176015.aspx
        self.id = str(uuid.uuid4()).upper()
        self.state = RunspacePoolState.BEFORE_OPEN
        self.connection = connection
        resource_uri = "http://schemas.microsoft.com/powershell/%s" \
                       % configuration_name
        self.shell = WinRS(connection, resource_uri=resource_uri, id=self.id,
                           input_streams='stdin pr', output_streams='stdout')
        self.ci_table = {}
        self.pipelines = {}
        self.session_key_timeout_ms = session_key_timeout_ms

        # Extra properties that are important and can control the RunspacePool
        # behaviour
        self.apartment_state = apartment_state
        self.thread_options = thread_options
        self.host = host
        self.protocol_version = None
        self.ps_version = None
        self.serialization_version = None
        self.user_events = []

        self._application_private_data = None
        self._min_runspaces = min_runspaces
        self._max_runspaces = max_runspaces
        self._serializer = Serializer()
        self._fragmenter = Fragmenter(self.connection.max_payload_size,
                                      self._serializer)
        self._exchange_key = None
        self._key_exchanged = False
        self._new_client = False
        self._ci_counter = 0
def __init__ ( self , connection , apartment_state = ApartmentState . UNKNOWN , thread_options = PSThreadOptions . DEFAULT , host = None , configuration_name = DEFAULT_CONFIGURATION_NAME , min_runspaces = 1 , max_runspaces = 1 , session_key_timeout_ms = 60000 ) : log . info ( "Initialising RunspacePool object for configuration %s" % configuration_name ) # The below are defined in some way at # https://msdn.microsoft.com/en-us/library/ee176015.aspx self . id = str ( uuid . uuid4 ( ) ) . upper ( ) self . state = RunspacePoolState . BEFORE_OPEN self . connection = connection resource_uri = "http://schemas.microsoft.com/powershell/%s" % configuration_name self . shell = WinRS ( connection , resource_uri = resource_uri , id = self . id , input_streams = 'stdin pr' , output_streams = 'stdout' ) self . ci_table = { } self . pipelines = { } self . session_key_timeout_ms = session_key_timeout_ms # Extra properties that are important and can control the RunspacePool # behaviour self . apartment_state = apartment_state self . thread_options = thread_options self . host = host self . protocol_version = None self . ps_version = None self . serialization_version = None self . user_events = [ ] self . _application_private_data = None self . _min_runspaces = min_runspaces self . _max_runspaces = max_runspaces self . _serializer = Serializer ( ) self . _fragmenter = Fragmenter ( self . connection . max_payload_size , self . _serializer ) self . _exchange_key = None self . _key_exchanged = False self . _new_client = False self . _ci_counter = 0