I need to delete all libraries from a subsite, however I got this error:
Collection was modified; enumeration operation may not execute
$web = Get-SPweb($webUrl)
foreach($list in $web.Lists) {
if($list.BaseType -eq "DocumentLibrary")
{
write-host $list.BaseType
$list.Delete
}
}