As part of a larger script i'm making a refrencelist of servernames which should contain all servers in our infrastructure. To do this i have 4 arrays with servernames sourced from diffrent systems (AD, SQL etc) which i planned to join together using:
$Refrencelist = $var1.Name + $var2.Name + $var3.Name + $var4.Name | Select-Object -Unique
Altough this mostly does the job i'm still seeing some duplicates in the resultning list and from what i can gather it's because the MemberType of the .Name property in the SQL $var is Property while the MemberType of Name in the other varibales is NoteProperty.
Is this what's causing the duplicates? If so, how do i solve this?
Thanks.