You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New-CosmosDbDocument - PowerShell is returning error "Cannot convert 'System.Collections.ArrayList' to the type 'System.String' required by parameter 'Message'. Specified method is not supported."
#468
Open
takis-kapas opened this issue
Feb 9, 2023
· 0 comments
I am getting the CosmosDB noSQL context using a Service Principal that has the "Contributor" role in the CosmosDB account.
I am building a JSON document, based on your instruction in the "New-CosmosDbDocument" module
When I am trying to execute the command "New-CosmosDbDocument -Context $cosmosDbContext -CollectionId $collectionName -DocumentBody $document" I am getting the following error from PowerShell:
Write-Error : Cannot convert 'System.Collections.ArrayList' to the type 'System.String' required by parameter 'Message'. Specified method is not supported.
At line:4 char:17
Write-Error $Error
CategoryInfo : InvalidArgument: (:) [Write-Error], ParameterBindingException
FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.WriteErrorCommand
System Information
PS Version: 5.1.19041.2364
Client: PowerShell ISE, VS Code
OS: Windows 10
Module Version: CosmosDB 4.7.0
The text was updated successfully, but these errors were encountered:
Issue
I am getting the CosmosDB noSQL context using a Service Principal that has the "Contributor" role in the CosmosDB account.
I am building a JSON document, based on your instruction in the "New-CosmosDbDocument" module
When I am trying to execute the command "New-CosmosDbDocument -Context $cosmosDbContext -CollectionId $collectionName -DocumentBody $document" I am getting the following error from PowerShell:
$document = @"
{
"id
":"$([Guid]::NewGuid().ToString())
","content
":"Some string
","more
":"Some other string
"}
"@
New-CosmosDbDocument -Context $cosmosDbContext -CollectionId $collectionName -DocumentBody $document
Write-Error : Cannot convert 'System.Collections.ArrayList' to the type 'System.String' required by parameter 'Message'. Specified method is not supported.
At line:4 char:17
Write-Error $Error
CategoryInfo : InvalidArgument: (:) [Write-Error], ParameterBindingException
FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.WriteErrorCommand
System Information
The text was updated successfully, but these errors were encountered: