pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

Add-PnPListItem multivalue people picker doesn't add people #1596

Open GiantX1 opened 6 years ago

GiantX1 commented 6 years ago

Reporting an Issue

Expected behavior

When using the cmdlet "Add-PnPListItem -List "Projects" -Values @{"Title" = "$TitleOfSite"; "Projectmember" = "abc@def, abc@xyz"}" I expect to see that the users will be added to the people field "Projectmember". Allow multiple selections setting is on for this field.

Actual behavior

None of the users are added to the field "Projectmember". When testing it with 1 user, the user is added to the field, but if more than 1 user, none of the users are added. I get the following error:

Add-PnPListItem : The specified user abc@def, abc@xyz could not be found.

It seems like it sees the multiple users as 1 user and not as multiple users.

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

2.26.1805.1

How did you install the PnP-PowerShell Cmdlets?

iainwyatt commented 6 years ago

The user string isn't parsed - using a string array will work:

Add-PnPListItem -List "Projects" -Values @{"Title" = "$TitleOfSite"; "Projectmember" = @("abc@def","abc@xyz")}"