Forum Discussion

Umair Naeem's avatar
Umair Naeem
Copper Contributor
Oct 07, 2016
Solved

Set-SPOListItem with multi-value people column

If I do Set-SPOListItem with string variable it gives error. Please see following:

 

$value="David Longmuir","Conf Room Stevens"

Set-SPOListItem -List $bidDetailsList -Web $web -Values @{$key=$value} -Identity $itemCheck.Id

 

Error: Set-SPOListItem : The specified user "David Longmuir","Conf Room Stevens" could not be found.

 

The following line works:

Set-SPOListItem -List $bidDetailsList -Web $web -Values @{$key="David Longmuir","Conf Room Stevens"} -Identity $itemCheck.Id

 

What is the best way to set the multi-value people field using a variable?  As obviously I cannot hard code the usernames.

Resources