Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从powershell中批量删除Azure Cosmos数据库_Powershell_Azure Cosmosdb - Fatal编程技术网

从powershell中批量删除Azure Cosmos数据库

从powershell中批量删除Azure Cosmos数据库,powershell,azure-cosmosdb,Powershell,Azure Cosmosdb,我正在使用Microsoft.Azure.CosmosDB.BulkExecutor在Azure Cosmos DB中实现BulkDelete。我正在使用powershell脚本调用bulkexecutor方法。但是当$idAndPartitionKeys不为空时,BulkDelete方法将返回null。下面是我为创建BulkDelete方法的输入而编写的代码 $pkIdTuplesToDelete = [System.Collections.Generic.List[System.Tuple[

我正在使用Microsoft.Azure.CosmosDB.BulkExecutor在Azure Cosmos DB中实现BulkDelete。我正在使用powershell脚本调用bulkexecutor方法。但是当$idAndPartitionKeys不为空时,BulkDelete方法将返回null。下面是我为创建BulkDelete方法的输入而编写的代码

$pkIdTuplesToDelete = [System.Collections.Generic.List[System.Tuple[string,string]]]::new()
Foreach($entry in $idAndPartitionKeys){
                    $tupleEntry = 
[System.Tuple]::Create($entry.partitionKey, $entry.id);
                    $pkIdTuplesToDelete.Add($tupleEntry);
                }
                $bulkDeleteResponse = $bulkExecutorObj.BulkDeleteAsync($pkIdTuplesToDelete).Result;

这是什么意思?:当$idAndPartitionKeys不为空时,BulkDelete方法始终返回null,而BulkDelete方法返回null。如果它总是返回null,那么它总是返回null。对不起,这是一个输入错误。我编辑了这个问题。但是没有足够的代码可以复制