SharePoint 2010 PowerShell snippit for deleting all items in a list


Warning: count(): Parameter must be an array or an object that implements Countable in /nfs/c01/h05/mnt/6385/domains/uhleeka.com/html/blog/wp-content/plugins/uhleeka-codebox/uhleeka-codebox.php on line 65
$SPAssignment = Start-SPAssignment;

$SPWeb = Get-SPWeb https://my.sharepoint.site.com -AssignmentCollection $SPAssignment;

$items = $SPWeb.Lists["My List to Delete All Items"].Items;
while($items.Count -gt 0){$items.Delete(0)};

Stop-SPAssignment $SPAssignment;