Forum Discussion
taise0713
Jul 26, 2022Copper Contributor
Set-PnPListItem command not working in batch.
I am trying to perform an update of a document library value with the Set-PnPListItem command.
-batch parameter is not working properly, what is the solution?
When Using -batch parameter, Must Identity parameter be ID not GUID?
Working:
$ListItems = Get-PnPListItem -List $List -PageSize 2000
$ListItem = $ListItems | where { $_["GUID"] -eq xxxx-xxxx-xxxx-xxxx }
Set-PnPListItem -List $config.Config.LibraryName -Identity $ListItem -Values $ItemValueNot woking:
$ListItems = Get-PnPListItem -List $List -PageSize 2000
$ListItem = $ListItems | where { $_["GUID"] -eq xxxx-xxxx-xxxx-xxxx }
Set-PnPListItem -List $config.Config.LibraryName -Identity $ListItem -Values $ItemValue -Batch $batchError:
Set-PnPListItem : Cannot find item with Identity PnP.PowerShell.Commands.Base.PipeBinds.ListItemPipeBind
発生場所 C:\Work\property_update.ps1:235 文字:9
+ Set-PnPListItem -List $config.Config.LibraryName -Identity $L ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Set-PnPListItem], PSArgumentException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Lists.SetListItemThe $ListItem definitely has the item registered.
I specified $ListItem.Id as a test, but the error occurred.
I get an error like Length cannot be less than 0.
Not woking:
$ListItems = Get-PnPListItem -List $List -PageSize 2000
$ListItem = $ListItems | where { $_["GUID"] -eq xxxx-xxxx-xxxx-xxxx }
Set-PnPListItem -List $config.Config.LibraryName -Identity $ListItem.id -Values $ItemValue -Batch $batchMore information:.
The character encoding of the .ps1 file is UTF-8 with BOM.
The OS language is Japanese.
1 Reply
- ZollingerCopper ContributorLooks like a known bug: https://github.com/pnp/powershell/issues/3334