Post update hook fails to run via Drush, but works via update.php I've implemented hook_post_update_NAME to bulk import some files into Drupal (creating file and media entities for them). This hook runs correctly when I use update.php. But it seems to silently fail via drush updb.
My update hooks looks like this
/**
 * Creates SVG icons as media entities.
 */
function my_module_default_content_post_update_create_icons() {

  $module_handler = \Drupal::service('module_handler');
  $module_path = $module_handler-&gt;getModule('my_module_default_content')-&gt;getPath();

  \Drupal::logger('my_module_default_content')-&gt;notice('Importing icons from @path', ['@path' =&gt; $module_path]);

  $dir = new DirectoryIterator(&quot;$module_path/icons&quot;);

  \Drupal::logger('my_module_default_content')-&gt;notice('Directory contains @count items', ['@count', count($dir)]);

  foreach ($dir as $fileinfo) {
    if (!$fileinfo-&gt;isDot()) {

      \Drupal::logger('my_module_default_content')-&gt;notice('Importing file @file', ['@file' =&gt; $fileinfo-&gt;getFilename()]);

      my_module_default_content_create_icon($fileinfo-&gt;getPathname());
    }
  }
}

This works fine via update.php. All the files are copied, relevant entities created, and messages logged to watchdog. When running drush updb I only get

[ok] Update completed: my_module_default_content_post_update_create_icons
[success] Finished performing updates.

None of my log messages are output (while using --debug option) to the screen or to watchdog.
My initial thought was a permissions issue, but if it's not outputting any of my log messages. I'm not positive the function is even being run. Adding in a die() on the first line of the function gave the exact same output/outcome.
Any ideas on what could cause this to silently fail when running via Drush?
For anyone else who runs into this, make sure that the post-update hooks are defined in a MODULE_NAME.post_update.php file. It seems as though update.php will happily invoke post-update hooks defined in the MODULE_NAME.install file, while Drush will not.