Forum Discussion
Matt_P_Standing
Feb 22, 2024Brass Contributor
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"} |...
- Feb 22, 2024
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
LainRobertson
Feb 22, 2024Silver 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_Standing
Feb 22, 2024Brass Contributor
HERO!!!!
Thank you Lain!
Thank you Lain!