CosmosDB
CosmosDB copied to clipboard
Unable to find type [CosmosDB.UniqueKeyPolicy.Policy]
When running:
$SetCosmosDbCollectionParameters = @{ Context = $CosmosDbContext Database = $CosmosDbConfiguration.DatabaseName Id = $Collection.CollectionName }
Set-CosmosDbCollection @SetCosmosDbCollectionParameters
The following error is returned:
Unable to find type [CosmosDB.UniqueKeyPolicy.Policy]. At C:\Program Files\WindowsPowerShell\Modules\CosmosDB\2.1.15.239\CosmosDB.psm1:1795 char:9
I'm conditionally setting DefaultTimeToLive as well but this error occurs whether that parameter is added to the hashtable or not
$PSVersionTable Name Value
PSVersion 5.1.17134.407 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.407 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
PowerShell Host: VS Code terminal
Operating System: Windows 10
CosmosDb PowerShell Module Version: 2.1.15.239
Thanks for raising this @NickGraham101 - I'll take a look this as soon as possible and figure out what might be going on.