def execute_command_with_connection(self, context, command, *args):
        """
        Note: session & vcenter_data_model & reservation id objects will be injected dynamically to the command
        :param command:
        :param context: instance of ResourceCommandContext or AutoLoadCommandContext
        :type context: cloudshell.shell.core.context.ResourceCommandContext
        :param args:
        """

        logger = self.context_based_logger_factory.create_logger_for_context(
            logger_name='vCenterShell',
            context=context)

        if not command:
            logger.error(COMMAND_CANNOT_BE_NONE)
            raise Exception(COMMAND_CANNOT_BE_NONE)

        try:
            command_name = command.__name__
            logger.info(LOG_FORMAT.format(START, command_name))
            command_args = []
            si = None
            session = None
            connection_details = None
            vcenter_data_model = None

            # get connection details
            if context:
                with CloudShellSessionContext(context) as cloudshell_session:
                    session = cloudshell_session

                vcenter_data_model = self.resource_model_parser.convert_to_vcenter_model(context.resource)
                connection_details = ResourceConnectionDetailsRetriever.get_connection_details(session=session,
                                                                                               vcenter_resource_model=vcenter_data_model,
                                                                                               resource_context=context.resource)

            if connection_details:
                logger.info(INFO_CONNECTING_TO_VCENTER.format(connection_details.host))
                logger.debug(
                    DEBUG_CONNECTION_INFO.format(connection_details.host,
                                                 connection_details.username,
                                                 connection_details.port))

                si = self.get_py_service_connection(connection_details, logger)
            if si:
                logger.info(CONNECTED_TO_CENTER.format(connection_details.host))
                command_args.append(si)

            self._try_inject_arg(command=command,
                                 command_args=command_args,
                                 arg_object=session,
                                 arg_name='session')
            self._try_inject_arg(command=command,
                                 command_args=command_args,
                                 arg_object=vcenter_data_model,
                                 arg_name='vcenter_data_model')
            self._try_inject_arg(command=command,
                                 command_args=command_args,
                                 arg_object=self._get_reservation_id(context),
                                 arg_name='reservation_id')
            self._try_inject_arg(command=command,
                                 command_args=command_args,
                                 arg_object=logger,
                                 arg_name='logger')

            command_args.extend(args)

            logger.info(EXECUTING_COMMAND.format(command_name))
            logger.debug(DEBUG_COMMAND_PARAMS.format(COMMA.join([str(x) for x in command_args])))

            results = command(*tuple(command_args))

            logger.info(FINISHED_EXECUTING_COMMAND.format(command_name))
            logger.debug(DEBUG_COMMAND_RESULT.format(str(results)))

            return results
        except Exception as ex:
            logger.exception(COMMAND_ERROR.format(command_name))
            logger.exception(str(type(ex)) + ': ' + str(ex))
            raise
        finally:
            logger.info(LOG_FORMAT.format(END, command_name))