I have a little script to delete a couple of objects in a sharepoint site. My code is:
> cat myscript.ps1
$web = get-spweb -Identity
http://mysp2010farm/sites/simplestuff
$list = $web.lists["Keywords"]
$list.AllowDeletion = $true
$list.Update()
$list.Delete()
$list = $web.lists["Knowledge Base"]
$list.AllowDeletion = $true
$list.Update()
$list.Delete()
Exception calling "Update" with "0" argument(s): "<nativehr>0x80070005</nativehr><nativestack></nativestack>"
At line:1 char:13
+ $list.Update <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException