How to export an ADFS custom webtheme and import it to another server

As it is recommended on the following TechNet article:

"It is strongly recommended to validate your customizations in an alternate environment and test them prior to rolling it out onto production AD FS servers. This reduces the chances of end users being exposed to these customizations prior to validation."

Unless you have saved all the PowerShell cmdLet you typed to create your custom theme in your pre-production environment, it is quite challenging to recreate the exact same webtheme on your production servers. It is easy to export a configuration with the Export-WebTheme cmdLet. But it does not give you the ability to re-import what you just exported. I wrote the following script to help with that: 

In a nutshell, we create our custom theme in our lab for example. In my case my webtheme is called Yoga. You export it to a folder:

Now you have a folder called C:\WebThemeExport that contains all your customization. Here is the content:

Then you copy this folder to your production server and you import the content:

All custom logos, illustrations, CSS and JavaScript will be imported in an existing theme or in a new theme, your call.