How to call helper function from my_module.admin.inc file in drush command? I have some function in the mymodule.admin.inc file that i want call from a drush command and i have done the following below in the mymodule.drush.inc

function mymodule_drush_command() {
      $items['custom-cmd'] = array(
         'description' =&gt;'some description',
         'aliases' =&gt; array('ccmd'),
         'examples' =&gt; array('drush ccmd'),
      );
      return $items;
 }

 function drush_mymodule_custom_cmd() {
     module_load_include('inc', 'mymodule', 'includes/mymodule.admin');
     _helper_func();
 }


The helper function is something along the lines of this (mymodule.admin.inc):

function _helper_func() {
    //do something
}


When i try the module_load_include function and i run the drush command i get an error similar to:

'PHP Fatal error:  Call to undefined function module_load_include()...'


I am unable to find a good resource to help me figure out why the helper function is not called from the drush command.
The module_load_include() function can be invoked from Drush; it sounds to me as if some other parts of your Drush setup might not be working properly.

Here's a sample Drush implementation, similar to what you want to do:

/**
 * Implements hook_drush_command().
 */
function YOUR_MODULE_drush_command() {
  $items['your-full-command'] = array(
    'callback' =&gt; 'YOUR_MODULE_hello_command',
    'description' =&gt; dt('Description of your Drush command.'),
    'bootstrap' =&gt; DRUSH_BOOTSTRAP_DRUSH,
    'aliases' =&gt; array('your-alias1', 'your-alias2'),
  );

  return $items;
}

/**
 * Command to download the Chosen plugin.
 */
function YOUR_MODULE_hello_command() {
  // Include your file.
  module_load_include('inc', 'YOUR_MODULE', 'includes/YOUR_MODULE.admin');
  // Invoke your function.
  _helper_func();
  // Show a message to the screen.
  drush_log(dt('Custom command executed.'), 'success');
}


You can see a working example in my custom module boilerplate.