Is is possible to call a function inside a .inc file of a module via drush eval? I have a module with additional (.inc) files containing functions I need to run via Drush. I know it is possible to run drush eval, but when I try to do it for those functions I get the following error:


  PHP Fatal error:  Call to undefined function my_module_my_function() in /usr/share/php/drush/commands/core/core.drush.inc(1037) : eval()'d code on line 1


This command works (the function is in the .module file).

drush eval 'my_module_cron();'


This command does not work (the function is in the .inc file).

drush eval 'my_module_my_function();'


Is there any workaround, besides moving the function in the module?
You could add module_load_include() to your eval code like you would anywhere else.

Like this:

drush eval "module_load_include('inc', 'my_module', 'INCLUDE_FILE_NAME_WITHOUT_EXTENSION'); my_module_my_function();"