I've got a SharePoint with a view called Retention that has around half a million entries, I want to delete the entries in the view from SharePoint as they are no longer required but I've not been able to find a quick way of doing this using PowerShell.
I've found this script and though it works it is incredibly slow, almost an hour to delete 3000 items;
Add-PSSnapin Microsoft.SharePoint.PowerShell Function Cleardown { #Add-PSSnapin Microsoft.SharePoint.PowerShell # Get SharePoint list $web = Get-SPWeb "SP Web Address" $list = $web.Lists["List Name"] $view = $list.Views["View Name"] $items = $list.GetItems($view) $items.count # Loop through view for ($i=$items.count-1; $i -ge 0; $i--) { $item = $items[$i]; $item.Recycle(); Write-host -NoNewLine "$i `r" } $Web = "" } For ($loop=1; $loop -le 1; $loop++) #967 { write-host "Pass " $loop Cleardown } Any suggestions for a way of doing this?
Thank you.