I have an array in Powershell with some strings, for example
$StringArray = {"all_srv_inf", "all_srv_inf_vir", "all_srv_inf_vir_vmw", "all_srv_rol", "all_srv_rol_iis", "all_srv_rol_dc"}
I would like to filter all strings in the array, so only the most unique ones are left over.
So, in the above example, I would have to filter "all_srv_inf", "all_srv_inf_vir" and "all_srv_rol" resulting in a string array with only these value: "all_srv_inf_vir_vmw", "all_srv_rol_iis" and "all_srv_rol_dc"
The list is actually a lot longer, so I what would be the most efficient way to filter my Powershell string array?
Thanks.