SharePoint - How Delete all List Items using PowerShell
Edvaldo Barbosa Guimar?es Filho
Business AI Transformation Specialist, SharePoint, Microsoft 365 & Power-Plataform Specialist
In Large SharePoint lists sometimes we need to clear (delete) all list items. The following script will do this task.
$site=Get-SPSite "URL" $web=$site.RootWeb $list=$web.Lists["List Title"] while ( $list.Items.Count -gt 0){$list.Items[0].Delete(); Write-host("Remaining "+$list.Items.Count+ " Itens"; }