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 -

django - CSRF verification failed. Request aborted. CSRF cookie not set -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -