diff --git a/drush/config_devel.drush.inc b/drush/config_devel.drush.inc
index dca459c..0d1c33b 100644
--- a/drush/config_devel.drush.inc
+++ b/drush/config_devel.drush.inc
@@ -45,9 +45,19 @@ function config_devel_drush_command() {
  * Drush command callback.
  */
 function drush_config_devel_export($extension) {
+  // Determine the type of extension we're dealing with.
+  $type = NULL;
+  if (\Drupal::moduleHandler()->moduleExists($extension)) {
+    $type = 'module';
+  }
+  elseif (\Drupal::service('theme_handler')->themeExists($extension)) {
+    $type = 'theme';
+  }
+  elseif (drupal_get_profile() === $extension) {
+    $type = 'profile';
+  }
 
-  if (($module_exists = \Drupal::moduleHandler()->moduleExists($extension)) || \Drupal::service('theme_handler')->themeExists($extension)) {
-    $type = $module_exists ? 'module' : 'theme';
+  if ($type) {
     $filename = drupal_get_path($type, $extension) . '/' . $extension .'.info.yml';
     $info = \Drupal::service('info_parser')->parse($filename);
 
@@ -64,6 +74,9 @@ function drush_config_devel_export($extension) {
       }
     }
   }
+  else {
+    drush_set_error("Couldn't export configuration. The '$extension' extension is not enabled.");
+  }
 }
 
 /**
