This code is an extension of the files written by Marc Duiker, so all credits to him :)

His blog post can be found here https://blog.marcduiker.nl/2016/12/28/hands-on-with-sitecore-helix-using-powershell-add-module.html and make sure to read it in order to know how to use and install this module.

The installation and usage completely remain the same. Compared to his files, there are couple of changes:

  • add-helixmodule.ps1 - added support for *.scproj files
  • add-helix-module-configuration.json – added support for *.scproj files
  • template examples for TDS and VS projects

All files can be fount on Git: https://github.com/unaverhoeven/TDS-Helix

Example template for TDS project:

Example template for VS project:

The above examples are for guidance purposes only. I tried to make it as generic as possible but, we all use different versions of VS, TDS, different NuGet packages, etc. The above TDS example uses TDS 5.7 version installed with a NuGet package. Your version may be different or perhaps you have a folder where your references are. The same goes for VS project, different versions, dlls, etc.

Template files that you need to modify are:

  • For TDS project

  • _NamespacePrefix_._ModuleType_._Name_.TDS.scproj

  • package.config

  • For VS project

  • _NamespacePrefix_._ModuleType_._Name_.csproj

  • package.config

  • Configuration

  • NuGet_profile.ps1

  • add-helix-module-configuration.json

Note: if you are not using NuGet for TDS, you do not need package.config. Configuration is fully explained on Marc's blog.

Now, these examples should be modified according to your project needs. They are not the holy grail, but they should give you enough knowledge to modify or setup your own ones.

Post Steps for TDS project

  • Refer TDS project to the VS project
  • Enable code generation, etc

How to run the module

The important thing here is that your solution follows folder structure:

  • Feature
  • Foundation
  • Project

PowerShell script depends on it.

  • Open Packager Manager Console.
  • For adding a Feature use Add-Feature YOUR_FEATURE_NAME.
  • For adding a Foundation use Add-Foundation YOUR_FEATURE_NAME.

This is how it should look in Package Manager Console:

and in Solution tree