Delete all items from the list

Sviatoslav Bulash -

Use this script if you need to delete all items from list.

Replace URL with your root site url.

Replace LIST_NAME with list display name.


$Sc_URL = "http://URL/es/" $SPAssignment = Start-SPAssignment
$SPWeb = Get-SPWeb $sc_url -AssignmentCollection $spAssignment
$array = New-Object System.Collections.ArrayList
$n = 0
$k = 0
$list = $SPWeb.Lists["LIST_NAME"]
foreach ($el in $list.items)
$n = $array.count -1
for ($k = $n; $k -ge 0; $k--)
Have more questions? Submit a request


Powered by Zendesk