docs: function () {
              count++;
  
              // all modules have been removed.
              if (count === removeModules.length) {
                  // check if solution file content needs to be updated.
                  if (isDirty) {
                      writeSolutionFileContents();
                      return;
                  }
  
                  // slight delay to ensure future tasks can interact with module files.
                  setTimeout(done, 500);
                  return;
              }
  
              var moduleName = removeModules[count],
                  moduleDir =  path.join(options.orchard, SOLUTION_MODULES_DIRECTORY, moduleName),
                  moduleProject = path.join(moduleDir, moduleName + '.csproj'),
                  moduleGuid;                
              
              helpers.getProjectGuid(moduleProject, function (moduleGuid) {
                 if (grunt.file.exists(moduleDir)) {
                      grunt.file.delete(moduleDir);
                  }
  
                  // module already exists in the solution, move onto the next one.
                  if (alreadyNotInSolution(moduleGuid)) {
                      removeNextModule();
                      return;
                  }
  
                  var escapedModuleName = moduleName.replace('.','\\.');
                  var escapedModuleGuid = moduleGuid.replace('{','{\\s*').replace('}','\\s*}');
  
                  /**
                   * Cleans any project reference elements
                   */
                  var projectReferencePatternString = '(Project\\(\\"\\s*{\\s*FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\\s*}\\s*\\"\\)\\s*=\\s*\\"' + escapedModuleName + '",\\s*\\"Orchard\\.Web\\\\Modules\\\\' + escapedModuleName + '\\\\' + escapedModuleName + '\\.csproj\\",\\s*\\"\\s*' + escapedModuleGuid + '\\s*\\"\\s*EndProject\\s*)';
  
                  /**
                   * Cleans any post project project section elements
                   */
                  var postProjectProjectSectionPattern = '('+escapedModuleGuid+'\\s*=\\s*\\{[A-Fa-f0-9\\-]*\\}\\s*)';
  
                  /**
                   * Cleans any project configuration platforms elements
                   */
                  var projectConfigurationPlatformsPattern = '(' + escapedModuleGuid + '\\.\\w*\\s*\\|{1,10}.*Any CPU\\s*)';
  
  
                  /**
                   * Create and apply regex to clear out matching content
                   */
                  solutionFileContents = solutionFileContents.replace(new RegExp(projectReferencePatternString, 'g'), '');
                  solutionFileContents = solutionFileContents.replace(new RegExp(postProjectProjectSectionPattern, 'g'), '');
                  solutionFileContents = solutionFileContents.replace(new RegExp(projectConfigurationPlatformsPattern, 'g'), '');                
  
  
                  isDirty = true;
  
                  removeNextModule();
              }, function (err) {
                  if (grunt.file.exists(moduleDir)) {
                      grunt.file.delete(moduleDir);
                  }
                  
                  removeNextModule();
             });
          }