How do I remove characters in my results with Powershell -


i'm new powershell, i'm having little trouble pulling exact information need. want pull security groups given folder can pipe command pulls members of group. pull groups, right have:

$groups = @((get-acl $folder).access | select-object -expandproperty identityreference) 

that pulls want, puts in domain/group format can't use. can rid of , including "\", group names can piped new command?

you can use -replace switch replace matches regular expression. so, rid of first "\" in each group name, add end of line of code: -replace "^.+\\"

$groups = @((get-acl $folder).access | select-object -expandproperty identityreference) -replace "^.+\\" 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c# - How do I get the Nth largest element from a list with duplicates, using LINQ? -

jsp - "Sending a redirect is forbidden after the response has been committed" in sendRedirect -