Closed guptarajesh001 closed 4 years ago
The error says there's a problem with the value you're passing -Identity. What's the value of $listitem? How does that compare to the values passed to -Identity in the Examples?
Thanks, this issue is resolved now, however this code work well with Powershell 5.1,
Can you post the resolution so that anyone that finds this bug later will benefit from it.
Issue in the script : $updateItem = Set-PnPListItem -List $listTitle -Identity $listItem -Values @{"Status" = "Completed" } Resolved by script: Set-PnPListItem -List $listTitle -Identity $listItem.Id -Values @{"Status" = "Completed" }
I have used PowerShell 7 version to update list item in the SharePoint online:
Connect-PnPOnline -Url $siteURL -Credentials $SPOCreds Set-PnPListItem -List $listTitle -Identity $listItem -Values @{"Status" = "Started" }
But I am getting error: Set-PnPListItem: Cannot bind parameter 'Identity'. Cannot convert value "Microsoft.SharePoint.Client.ListItem" to type "SharePointPnP.PowerShell.Commands.Base.PipeBinds.ListItemPipeBind". Error: "Cannot convert the "Microsoft.SharePoint.Client.ListItem" value of type "Deserialized.Selected.System.Management.Automation.PSCustomObject" to type "SharePointPnP.PowerShell.Commands.Base.PipeBinds.ListItemPipeBind".