Habi what-a-tat ? Create a Sitecore Helix solution from scratch using PowerShell

This post is all about creating a Helix based solution from scratch. Please watch the video for additional information and a demo of the script. I really discourage people from using Habitat as the base to create new solutions. Hopefully this script will help.

Also refer to Marc Duiker’s Hands-on with Sitecore Helix: Anatomy of the Add-HelixModule.ps1 PowerShell script.

So in order to create a Helix solution from scratch, we do not have any tool at this moment. We either manually build it or use Habitat as a base. I do not recommend using Habitat and modifying that solution to fit your needs.

To start of with, the best way to automate this is to use PowerShell scripts inside of the Visual Studio IDE via the Package Manager Console. We need to use DTE (EnvDTE).

Download the HabitatSolutionScript.ps1 from https://gist.github.com/akshaysura/184132f67decb749ae235b602351832c

Open Visual Studio IDE

Open Package Manager Console

Type in $profile

Open that location in Windows explorer. You might not have NuGet_profile.ps1 at that location. Create one.

Open the NuGet_profile.ps1 and insert the following line and modify the path to your HabitatSolutionScript.ps1

. “D:\Projects\PowerShell\HabitatSolutionScript.ps1”

Save and close NuGet_profile.ps1

Restart your Visual Studio IDE and open Package Manager Console

Type in let and tab or you could type in the whole command Lets-Rumble

Follow the on screen prompts and enjoy your solution. I would recommend watching the video for additional information.

The script is not tested so please use it at your own risk. Since it required an empty folder, it won’t affect your existing code/solutions.

 

 

Please contribute to this script and hopefully we can make it better for the entire community.

If you have any questions or concerns, please get in touch with me. (@akshaysura13 on twitter or on Slack).

4 comments

  • Hetal 1 month ago

    Nice one Akshay!!! Thanks for sharing!!!

  • Prasad 4 weeks ago

    Hi Akshay,

    Please update the command name in Article from “Lets_Rumble” to “Lets-Rumble”. It seems a typo.

  • akshaysuraadmin 4 weeks ago

    Updated. Thank you.

  • Mohamed Krimi 4 weeks ago

    Ho Akshay very nice script!! next step integrate with Sitecore Rocks to generate Data templates and rendering and it will rocks 🙂

Add your comment

Your email address will not be published.