How to forced uninstall a (missing) module using drush

Sometimes you forgot to uninstall a module when you removed it. To keep thing clean, uninstall the module using the following drush script.

drush php-eval '\Drupal::service("module_installer")->uninstall(["my_custom_module"]);'

 

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!