Skip to content

Instantly share code, notes, and snippets.

@KirillPashkov
Created August 8, 2017 11:03
Show Gist options
  • 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 = '[email protected]','[email protected]'
};
#$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