Remove-PnPListItem

Tip

We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/Remove-PnPListItem.md to change this file.

Deletes an item from a list

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" -Force

Removes the listitem with id "1" from the "Demo List" list

EXAMPLE 2

Remove-PnPListItem -List "Demo List" -Identity "1" -Force -Recycle

Removes 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 $batch

This will delete all the items with Id 1 to Id 50 in the specified list.

Parameters

-Batch

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
-Connection

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
-Force

Specifying the Force parameter will skip the confirmation question

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Identity

The ID of the listitem, or actual ListItem object

Type:ListItemPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-List

The ID, Title or Url of the list

Type:ListPipeBind
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Recycle

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