(self, method_identifier, args, runspace, pipeline=None)
return response
Run a host call method requested by the server and return the response
        from this method to send back to the server.
        https://msdn.microsoft.com/en-us/library/dd306624.aspx

        Each method will have access to the current runspace and pipeline (if
        applicable) during the method call as well as any args sent from the
        server.

        :param method_identifier: pypsrp.complex_objects.HostMethodIdentifier
            in the host call message.
        :param args: The list of arguments for the host call function.
        :param runspace: The runspace the host call relates to
        :param pipeline: The pipeline (if any) that the call relates to
        :return: The response (if any) to send back to the server
Run a host call method requested by the server and return the response
        from this method to send back to the server.
        https://msdn.microsoft.com/en-us/library/dd306624.aspx
Run a host call method requested by the server and return the response from this method to send back to the server . https : // msdn . microsoft . com / en - us / library / dd306624 . aspx
def run_method(self, method_identifier, args, runspace, pipeline=None):
        """
        Run a host call method requested by the server and return the response
        from this method to send back to the server.
        https://msdn.microsoft.com/en-us/library/dd306624.aspx

        Each method will have access to the current runspace and pipeline (if
        applicable) during the method call as well as any args sent from the
        server.

        :param method_identifier: pypsrp.complex_objects.HostMethodIdentifier
            in the host call message.
        :param args: The list of arguments for the host call function.
        :param runspace: The runspace the host call relates to
        :param pipeline: The pipeline (if any) that the call relates to
        :return: The response (if any) to send back to the server
        """
        response = None
        if method_identifier.value < 11:
            func = getattr(self, str(method_identifier))
            response = func(runspace, pipeline, *args)
        elif method_identifier.value < 27:
            func = getattr(self.ui, str(method_identifier))
            response = func(runspace, pipeline, *args)
        elif method_identifier.value < 52:
            func = getattr(self.ui.raw_ui, str(method_identifier))
            response = func(runspace, pipeline, *args)
        else:
            log.warning("Received unexpected/unsupported host method "
                        "identifier: %d" % method_identifier.value)

        return response
def run_method ( self , method_identifier , args , runspace , pipeline = None ) : response = None if method_identifier . value < 11 : func = getattr ( self , str ( method_identifier ) ) response = func ( runspace , pipeline , * args ) elif method_identifier . value < 27 : func = getattr ( self . ui , str ( method_identifier ) ) response = func ( runspace , pipeline , * args ) elif method_identifier . value < 52 : func = getattr ( self . ui . raw_ui , str ( method_identifier ) ) response = func ( runspace , pipeline , * args ) else : log . warning ( "Received unexpected/unsupported host method " "identifier: %d" % method_identifier . value ) return response