Is it possible to have one line powershell to delete all items in a list (no folders)?
I tried this one from http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/de844268-6bb5-4510-9c83-bbca24cf278f,
$list.get_items() | where { $_.column name with spaces -like '3*' } | % { $_.Delete() }.
In my case, I remove the middle part: $list.get_items() | % { $_.Delete() }
I got one item removed with the exception:
An error occurred while enumerating through a collection: Collection was modifi
ed; enumeration operation may not execute..
At line:1 char:1
+ <<<< $list.Get_Items() | % {$_.Delete()}
+ CategoryInfo : InvalidOperation: (Microsoft.Share...on+SPEnumer
ator:SPEnumerator) [], RuntimeException
+ FullyQualifiedErrorId : BadEnumeration
Seems I am missing some here - I am running Powershell through SharePoint 2010 Management Shell as Administrator.