Deploying a custom iOS Wi-Fi profile with password using Intune+ConfigMgr

One very common request when implementing Intune is to distribute a Wi-Fi profile with WPA2 and a preshared password. This is currently not possible either with Intune standalone or with Intune integrated with Configuration Manager 2012 using the UI. I have already written a post on how to create a custom iSO profile using Apple