Forum Discussion
Extracting the value from a pipeline variable
HELP! I am going mad with this!
I am trying to enumerate a SharePoint group name using PowerShell. I'm using this:
$SiteMembersGroup = get-pnpsitegroup | where {$_.Title -like "*members"} | select { $_.Title }Which gives me the output:
$_.Title
----------
AcmeCo Members
How do I extract JUST the value? I've tried dozens of ways and can't get it to work. There MUST be a simple way right?
Thanks for any pointers!
Matt
Hi, Matt.
If you don't want it presented as an object, use this format instead, as this will give you just a flattened string value - or a collection of strings if more than one site matches your wildcard specification.
$SiteMembersGroup = (get-pnpsitegroup | where {$_.Title -like "*members"}).Title;Cheers,
Lain
2 Replies
- LainRobertsonSilver Contributor
Hi, Matt.
If you don't want it presented as an object, use this format instead, as this will give you just a flattened string value - or a collection of strings if more than one site matches your wildcard specification.
$SiteMembersGroup = (get-pnpsitegroup | where {$_.Title -like "*members"}).Title;Cheers,
Lain
- Matt_P_StandingBrass ContributorHERO!!!!
Thank you Lain!