很难确定如何在powershell中执行与以下行相同的操作:
(在命名空间Microsoft.Azure.Documents中)
DocumentClient client = new DocumentClient(new Uri(“endpoint”),“authKey”)
数据库database = client.CreateDatabaseQuery() . 其中(d => d.Id ==“collectionName”) . AsEnumerable() . FirstOrDefault()
有人可以帮忙吗? TX
1 回答
看这里:https://alexandrebrisebois.wordpress.com/2014/08/23/using-powershell-to-seed-azure-documentdb-from-blob-storage/
它向您展示了如何在原始REST请求中使用authKey endpoints uri .
另外,请在此处研究DocumentDB的REST API:https://msdn.microsoft.com/en-us/library/azure/dn781481.aspx?f=255&MSPPError=-2147217396 .
它将允许您按照Alexandre的示例查找如何执行更多操作 .
还有这个powershell命令行开关DLL,可以轻松完成许多操作:https://github.com/savjani/Azure-DocumentDB-Powershell-Cmdlets