Clear-PnPRecycleBinItem

Tip

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

Permanently deletes all or a specific recycle bin item

Syntax

Clear-PnPRecycleBinItem
     [-All]
     [-SecondStageOnly]
     [-Force]
     [-RowLimit <Int32>]
     [-Connection <PnPConnection>]
     [<CommonParameters>]
Clear-PnPRecycleBinItem
     -Identity <RecycleBinItemPipeBind>
     [-Force]
     [-Connection <PnPConnection>]
     [<CommonParameters>]

Examples

EXAMPLE 1

Get-PnPRecycleBinItem | Where-Object LeafName -like "*.docx" | Clear-PnpRecycleBinItem

Permanently deletes all the items in the first and second stage recycle bins of which the file names have the .docx extension

EXAMPLE 2

Clear-PnpRecycleBinItem -Identity 72e4d749-d750-4989-b727-523d6726e442

Permanently deletes the recycle bin item with Id 72e4d749-d750-4989-b727-523d6726e442 from the recycle bin

EXAMPLE 3

Clear-PnpRecycleBinItem -Identity $item -Force

Permanently deletes the recycle bin item stored under variable $item from the recycle bin without asking for confirmation from the end user first

EXAMPLE 4

Clear-PnPRecycleBinItem -All -RowLimit 10000

Permanently deletes up to 10,000 items in the recycle bin

Parameters

-All

Clears all items

Type:SwitchParameter
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

If provided, no confirmation will be asked to restore the recycle bin item

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

Id of the recycle bin item or the recycle bin item itself to permanently delete

Type:RecycleBinItemPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-RowLimit

Limits deletion to specified number of items

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SecondStageOnly

If provided, only all the items in the second stage recycle bin will be cleared

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