Click here to Skip to main content
15,898,988 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I am running a unix command which is giving me the below output which i am storing in a string

,root,appdet,patrol,invscout,trnadm,da003sc,vendabe,sshd,webmd,webm,we002za,tr005ma,r3xadm,qa1adm,r3qadm,kwdadm,best1,ldap,ipsec,maestro,appdet,di003bo,sh506pa,su004sa,nex5ovt,nex46cd,nex8bth,BMCAudit,ve001na,nex3mzn,nex3slw,nex3orp,nex87vj,nex7uxw,nex7geg,nex7lmw,nex3hxf,nex8fas,root,bin,root,bin,sys,bin,adm,nuucp,uucp,,root,root,lp,root,,nobody,lpd,guest,,,root,lp,printq,imnadm,r3dadm,orar3d,d46adm,precise,pr1adm,csadm,su004sa,


HTML
$ResultOfMasterListUser = Get-Content "$LocalUserListFileLocation\$LocalUserList"


Now i want to remove the duplicates from the string.

Please tell me how to do this.

Thank you
Posted

1 solution

You should have a look at Split method:
about_Split[^]
Using the Split Method in PowerShell[^]

Hope this helps.
 
Share this answer
 
Comments
Black_Rose 18-Dec-15 2:43am    
Phil i am splitting it in next step. but how to remove the duplicate one's

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900