I use this in my environment for all installed features on our windows servers. Helpful when planning for a migration such as cloud compute.
###if exists (string values of selects “name from Win32_ServerFeature” of wmi) then (string values of selects “name from Win32_ServerFeature” of wmi) as string else “N/A”