DSC Extension: fix publish cmdlet required modules dependency logic to be more generic and suitable for next WMF release