PowerShell MongoDB MongoDB with C# driver 1.7 using PowerShell


Example

I need to query all the details from virtual machine and update into the MongoDB.

Which require the output look like this. 
{
    "_id" : ObjectId("5800509f23888a12bccf2347"),
    "ResourceGrp" : "XYZZ-MachineGrp",
    "ProcessTime" : ISODate("2016-10-14T03:27:16.586Z"),
    "SubscriptionName" : "GSS",
    "OS" : "Windows",
    "HostName" : "VM1",
    "IPAddress" : "192.168.22.11",
    "Tags" : {
        "costCenter" : "803344",
        "BusinessUNIT" : "WinEng",
        "MachineRole" : "App",
        "OwnerEmail" : "zteffer@somewhere.com",
        "appSupporter" : "Steve",
        "environment" : "Prod",
        "implementationOwner" : "xyzr@somewhere.com",
        "appSoftware" : "WebServer",
        "Code" : "Gx",
        "WholeOwner" : "zzzgg@somewhere.com"
    },
    "SubscriptionID" : "",
    "Status" : "running fine",
    "ResourceGroupName" : "XYZZ-MachineGrp",
    "LocalTime" : "14-10-2016-11:27"
}