(self)
Connects the runspace pool, Runspace pool must be in a disconnected
        state. This only supports reconnecting to a runspace pool created by
        the same client with the same SessionId value in the WSMan headers.
Connects the runspace pool, Runspace pool must be in a disconnected
        state. This only supports reconnecting to a runspace pool created by
        the same client with the same SessionId value in the WSMan headers.
Connects the runspace pool Runspace pool must be in a disconnected state . This only supports reconnecting to a runspace pool created by the same client with the same SessionId value in the WSMan headers .
def connect(self):
        """
        Connects the runspace pool, Runspace pool must be in a disconnected
        state. This only supports reconnecting to a runspace pool created by
        the same client with the same SessionId value in the WSMan headers.
        """
        log.info("Connecting to Runspace Pool")
        if self.state == RunspacePoolState.OPENED:
            return
        elif self.state != RunspacePoolState.DISCONNECTED:
            raise InvalidRunspacePoolStateError(
                self.state, RunspacePoolState.DISCONNECTED,
                "connect to a disconnected Runspace Pool"
            )

        if self._new_client:
            log.debug("Remote Runspace Pool was created with a different "
                      "client, connecting as new client")
            self._connect_new_client()
            self._new_client = False
        else:
            log.debug("Remote Runspace Pool was created with the same client, "
                      "connecting as an existing client")
            self._connect_existing_client()
def connect ( self ) : log . info ( "Connecting to Runspace Pool" ) if self . state == RunspacePoolState . OPENED : return elif self . state != RunspacePoolState . DISCONNECTED : raise InvalidRunspacePoolStateError ( self . state , RunspacePoolState . DISCONNECTED , "connect to a disconnected Runspace Pool" ) if self . _new_client : log . debug ( "Remote Runspace Pool was created with a different " "client, connecting as new client" ) self . _connect_new_client ( ) self . _new_client = False else : log . debug ( "Remote Runspace Pool was created with the same client, " "connecting as an existing client" ) self . _connect_existing_client ( )