I am trying to return the groups that a user is part of. When I get the results, often there is extra spaces to the right of the results. I would like to trim those off. Is there a way to use trim() functionality for the following line?
Get-ADPrincipalGroupMembership <user> | select name