docs: function () {
              count++;
  
              // all modules have been added have been added.
              if (count === modules.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 = modules[count];
              
              // ignore directory when module doesn't contain .csproj file.
              if (!fs.existsSync(path.join(options.modules, moduleName, moduleName + '.csproj'))) {
                  addNextModule();
                  return;
              }
  
              helpers.getProjectGuid(path.join(options.modules, moduleName, moduleName + '.csproj'), function (moduleGuid) {
                  // module already exists in the solution, move onto the next one.
                  if (alreadyInSolution(moduleGuid)) {
                      addNextModule();
                      return;
                  }
  
                  var projectReference = '\r\nProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "' + moduleName + '", "Orchard.Web\\Modules\\' + moduleName + '\\' + moduleName + '.csproj", "' + moduleGuid + '"\r\nEndProject\r\n';
                  var projectConfiguationPlatforms = '\t\t' + moduleGuid + '.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t' + moduleGuid + '.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t' + moduleGuid + '.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t' + moduleGuid + '.Release|Any CPU.Build.0 = Release|Any CPU\r\n';
  
                  solutionFileContents = _s.insert(solutionFileContents, solutionFileContents.lastIndexOf('EndProject') + 10, projectReference)
                  
                  var sectionStart = solutionFileContents.indexOf("GlobalSection(ProjectConfigurationPlatforms)");
                  var sectionEnd = sectionStart + solutionFileContents.substring(sectionStart).indexOf('EndGlobalSection');
  
                  solutionFileContents = _s.insert(solutionFileContents, sectionEnd, projectConfiguationPlatforms);
  
                  sectionStart = solutionFileContents.indexOf("GlobalSection(NestedProjects)");
                  sectionEnd = sectionStart + solutionFileContents.substring(sectionStart).indexOf('EndGlobalSection');
                  solutionFileContents = _s.insert(solutionFileContents, sectionEnd, '\t' + moduleGuid + ' = {' + SOLUTION_DIRECTORY_MODULES + '}\r\n\t');
  
                  isDirty = true;
  
                  addNextModule();
              });
          }