Skip to content

Instantly share code, notes, and snippets.

@KirillPashkov
Created August 8, 2017 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KirillPashkov/d8beb83199aa912b9bb143e6daf4c0ef to your computer and use it in GitHub Desktop.
Save KirillPashkov/d8beb83199aa912b9bb143e6daf4c0ef to your computer and use it in GitHub Desktop.
$mongoDriverPath = "$(Split-Path -Parent $MyInvocation.MyCommand.Path)\bin";
Add-Type -Path "$($mongoDriverPath)\MongoDB.Bson.dll";
Add-Type -Path "$($mongoDriverPath)\MongoDB.Driver.dll";
$bsonDoc = [MongoDB.Bson.BsonDocument] @{
Name = 'firstname surname'
EmailAddresses = 'username@gmail.com','username@mongodb.org'
};
#$bsonDoc.ToHashtable()
New-Object PSObject -Property $bsonDoc.ToHashtable()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment