Remove-PnPListItem
- Reference
Please rate your experience
Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services. Privacy policy.
Thank you.
Tip
We encourage you to make improvements to this documentation. Please navigate to //github.com/pnp/powershell/blob/dev/documentation/Remove-PnPListItem.md to change this file.
Deletes an item from a list
In this article
Syntax
Remove-PnPListItem [-List] <ListPipeBind> -Identity <ListItemPipeBind> [-Recycle] [-Force] Remove-PnPListItem [-List] <ListPipeBind> -Identity <ListItemPipeBind> -Batch <PnPBatch> [-Recycle]Examples
EXAMPLE 1
Remove-PnPListItem -List "Demo List" -Identity "1" -ForceRemoves the listitem with id "1" from the "Demo List" list
EXAMPLE 2
Remove-PnPListItem -List "Demo List" -Identity "1" -Force -RecycleRemoves the listitem with id "1" from the "Demo List" list and saves it in the Recycle Bin
EXAMPLE 3
$batch = New-PnPBatch 1..50 | Foreach-Object{Remove-PnPListItem -List "DemoList" -Identity $_ -Batch $batch} Invoke-PnPBatch -Batch $batchRemoves all the items with Id 1 to Id 50 in the "Demo List" list
EXAMPLE 4
Remove-PnPListItem -List "Demo List"Removes all items from the "Demlo List" list after asking for confirmation
Parameters
Batch object used to add items in a batched manner. See examples on how to use this.
Type: | PnPBatch |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: | PnPConnection |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifying the Force parameter will skip the confirmation question
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The ID of the listitem, or actual ListItem object
Type: | ListItemPipeBind |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The ID, Title or Url of the list
Type: | ListPipeBind |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
When provided, items will be sent to the recycle bin. When omitted, items will permanently be deleted.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Related Links
- Microsoft 365 Patterns and Practices