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
Post a Comment