title: The command was found in the module, but the module could not be loaded
body: <p>I am trying to create document in cosmosdb using PowerShell. The command is being run on PSCore on Linux, the execution policy is <code>Unrestricted</code> and unchangeable.</p>
  
  <p>I am running into this error:</p>
  
  <blockquote>
    <p>New-CosmosDbDocument : The 'New-CosmosDbDocument' command was found in
    the module 'CosmosDB', but the module could not be loaded. For more
    information, run 'Import-Module CosmosDB'</p>
  </blockquote>
  
  <p>Here is the code:</p>
  
  <pre><code>Import-Module CosmosDB
  
  $Guid = $([Guid]::NewGuid().ToString())
  $document = @" { ... } "@
  
  $cosmosDbContext = New-CosmosDbContext -Account $CosmosDbAccountName
  -Database $DatabaseName -ResourceGroup $ResourceGroupName     New-CosmosDbDocument -Context $cosmosDbContext -CollectionId $CollectionId -DocumentBody $document -PartitionKey "$Guid"
  </code></pre>