Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

PowerShell command reporting "Exception calling "Update" with "0" arguments

$
0
0

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

The odd thing is that I executed these statements without an issue earlier on a different site. Things worked without a problem. Now we are getting this error. Is there something else I need to do.

Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>