Attempting to bulk delete List Item using ProcessBatchData in a PowerShell script. Here is a command that my code is generating but I am getting an error when it executes. I have been unable to find the problem so I am hoping some CAML experts can shed some light as to what I am doing wrong.
$spWeb.ProcessBatchData("<?xml version='1.0' encoding='UTF-8'?><Batch><Method><SetList Scope='Request'>b37425b3-189d-4031-97f6-15e4ca767185</SetList><SetVar Name='ID'>480</SetVar><SetVar Name='Cmd'>Delete</SetVar></Method></Batch>");
Here is the Error:
Exception calling "ProcessBatchData" with "1" argument(s): "<nativehr>0x80070057</nativehr><nativestack></nativestack>"
At line:1 char:24
+ $spWeb.ProcessBatchData <<<< ("<?xml version='1.0' encoding='UTF-8'?><Batch><Method><SetList Scope='Request'>b37425b3-189d-4031-97f6-15e4ca767185</SetList><SetVar Name='ID'>480</SetVar><SetVar Name='Cmd'>Delete</SetVar></Method></Batch>");
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException