Nearby Connection keeps disconnected when sending files - google-nearby

I have implemented an app which allows user sending files using Nearby Connection API. But I faced problem that the connection keeps disconnected sometimes.
Here is the log I got when disconnected.
12-29 10:00:37.841 1068 1148 I RilClient: initialize: commandFd is 46
12-29 10:00:37.842 1068 1148 I RilClient: start listen on fd: 23, socket name: rild-oem
12-29 10:00:37.842 1068 1098 I RmcOemHandler: requestQueryThermal Enter: -1
12-29 10:00:37.842 1068 1098 I AT : [0] AT> AT+ETHERMAL (RIL_CMD_READER_1 tid:492184673472)
12-29 10:00:37.851 1068 1097 I AT : [0] AT< +ETHERMAL: 2, 32767, -127, 111, 32767, 3996 (RIL_CMD_READER_1, tid:492185713856)
12-29 10:00:37.851 1068 1097 I AT : [0] AT< OK (RIL_CMD_READER_1, tid:492185713856)
12-29 10:00:37.852 1068 1098 I RmcOemHandler: requestQueryThermal success
12-29 10:00:37.852 1068 1087 D RtcRilClientController: client 1001 handle requestComplete
12-29 10:00:37.853 777 777 I thermal_repeater: [recvMdThermalInfo] ret=33, strLen=127, 2, 32767, -127, 111, 32767, 3996
12-29 10:00:38.029 8310 23793 W Nearby : Method is still running after 810055 millis. [CONTEXT service_id=49 ]
12-29 10:00:38.029 8310 23793 W Nearby : ahds: ahds
12-29 10:00:38.029 8310 23793 W Nearby : at java.lang.Thread.sleep(Native Method)
12-29 10:00:38.029 8310 23793 W Nearby : at java.lang.Thread.sleep(Thread.java:442)
12-29 10:00:38.029 8310 23793 W Nearby : at java.lang.Thread.sleep(Thread.java:358)
12-29 10:00:38.029 8310 23793 W Nearby : at ahjv.a(:com.google.android.gms#204713047#20.47.13 (150406-344095733):7)
12-29 10:00:38.029 8310 23793 W Nearby : at ahjt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):4)
12-29 10:00:38.029 8310 23793 W Nearby : at ahjv.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):3)
12-29 10:00:38.029 8310 23793 W Nearby : at ahdp.run(Unknown Source:0)
12-29 10:00:38.029 8310 23793 W Nearby : at rlt.c(:com.google.android.gms#204713047#20.47.13 (150406-344095733):6)
12-29 10:00:38.029 8310 23793 W Nearby : at rlt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):7)
12-29 10:00:38.029 8310 23793 W Nearby : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-29 10:00:38.029 8310 23793 W Nearby : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-29 10:00:38.029 8310 23793 W Nearby : at rrp.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:38.029 8310 23793 W Nearby : at java.lang.Thread.run(Thread.java:923)
12-29 10:00:38.029 8310 23793 W Nearby : Caused by: ahds
12-29 10:00:38.029 8310 23793 W Nearby : at ahdt.a(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:38.029 8310 23793 W Nearby : at ahdl.execute(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:38.029 8310 23793 W Nearby : at ahjq.run(Unknown Source:6)
12-29 10:00:38.029 8310 23793 W Nearby : ... 7 more
12-29 10:00:38.159 8310 22681 W Nearby : Method is still running after 810184 millis. [CONTEXT service_id=49 ]
12-29 10:00:38.159 8310 22681 W Nearby : ahds: ahds
12-29 10:00:38.159 8310 22681 W Nearby : at java.net.SocketInputStream.socketRead0(Native Method)
12-29 10:00:38.159 8310 22681 W Nearby : at java.net.SocketInputStream.socketRead(SocketInputStream.java:119)
12-29 10:00:38.159 8310 22681 W Nearby : at java.net.SocketInputStream.read(SocketInputStream.java:176)
12-29 10:00:38.159 8310 22681 W Nearby : at java.net.SocketInputStream.read(SocketInputStream.java:144)
12-29 10:00:38.159 8310 22681 W Nearby : at java.io.BufferedInputStream.fill(BufferedInputStream.java:248)
12-29 10:00:38.159 8310 22681 W Nearby : at java.io.BufferedInputStream.read1(BufferedInputStream.java:288)
12-29 10:00:38.159 8310 22681 W Nearby : at java.io.BufferedInputStream.read(BufferedInputStream.java:347)
12-29 10:00:38.159 8310 22681 W Nearby : at java.io.DataInputStream.readFully(DataInputStream.java:198)
12-29 10:00:38.159 8310 22681 W Nearby : at java.io.DataInputStream.readInt(DataInputStream.java:389)
12-29 10:00:38.159 8310 22681 W Nearby : at ahhu.h(:com.google.android.gms#204713047#20.47.13 (150406-344095733):1)
12-29 10:00:38.159 8310 22681 W Nearby : at ahhu.g(:com.google.android.gms#204713047#20.47.13 (150406-344095733):2)
12-29 10:00:38.159 8310 22681 W Nearby : at ahjw.a(:com.google.android.gms#204713047#20.47.13 (150406-344095733):1)
12-29 10:00:38.159 8310 22681 W Nearby : at ahjt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):4)
12-29 10:00:38.159 8310 22681 W Nearby : at ahdp.run(Unknown Source:0)
12-29 10:00:38.159 8310 22681 W Nearby : at rlt.c(:com.google.android.gms#204713047#20.47.13 (150406-344095733):6)
12-29 10:00:38.159 8310 22681 W Nearby : at rlt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):7)
12-29 10:00:38.159 8310 22681 W Nearby : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-29 10:00:38.159 8310 22681 W Nearby : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-29 10:00:38.159 8310 22681 W Nearby : at rrp.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:38.159 8310 22681 W Nearby : at java.lang.Thread.run(Thread.java:923)
12-29 10:00:38.159 8310 22681 W Nearby : Caused by: ahds
12-29 10:00:38.159 8310 22681 W Nearby : at ahdt.a(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:38.159 8310 22681 W Nearby : at ahdl.execute(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:38.159 8310 22681 W Nearby : at ahjq.run(Unknown Source:4)
12-29 10:00:38.159 8310 22681 W Nearby : ... 7 more
12-29 10:00:38.194 551 551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:57.555767,dur:1007.72,max:19.07,min:15.94
More code I have. Got the log: Socket closed, but I don't know how to fix it.
If anyone know how to fix, please let me know. Thank you very much.
12-29 10:00:58.826 8310 26487 I NearbyConnections: EndpointManager failed the next Read read/write for endpoint 1mhc over its ENCRYPTED_WIFI_LAN EndpointChannel. [CONTEXT service_id=54 ]
12-29 10:00:58.826 8310 26487 I NearbyConnections: java.net.SocketException: Socket closed
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.net.SocketInputStream.socketRead0(Native Method)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.net.SocketInputStream.socketRead(SocketInputStream.java:119)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.net.SocketInputStream.read(SocketInputStream.java:176)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.net.SocketInputStream.read(SocketInputStream.java:144)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.io.BufferedInputStream.read(BufferedInputStream.java:347)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.io.DataInputStream.readFully(DataInputStream.java:198)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.io.DataInputStream.readFully(DataInputStream.java:172)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at ahhu.h(:com.google.android.gms#204713047#20.47.13 (150406-344095733):5)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at ahhu.g(:com.google.android.gms#204713047#20.47.13 (150406-344095733):2)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at ahjw.a(:com.google.android.gms#204713047#20.47.13 (150406-344095733):1)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at ahjt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):4)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at ahdp.run(Unknown Source:0)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at rlt.c(:com.google.android.gms#204713047#20.47.13 (150406-344095733):6)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at rlt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):7)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at rrp.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:58.826 8310 26487 I NearbyConnections: at java.lang.Thread.run(Thread.java:923)
12-29 10:00:58.871 1173 2466 I WifiService: enableTdls uid=10137 enable=false
```12-29 10:00:58.871 1173 2466 I WifiService: enableTdls uid=10137 enable=false
12-29 10:00:58.875 1173 1430 I WifiService: enableTdlsWithMacAddress uid=1000 enable=false
12-29 10:00:58.879 8310 28920 I NearbyConnections: EndpointChannelManager unregistered endpoint 1mhc [CONTEXT service_id=54 ]
12-29 10:00:58.880 8310 26487 I NearbyConnections: EndpointManager quit overall Read loop for endpoint 1mhc because there's no EndpointChannel for it. [CONTEXT service_id=54 ]
12-29 10:00:58.883 8310 28921 I NearbyMediums: Stopped listening for incoming Wifi Lan connections. [CONTEXT service_id=54 ]
12-29 10:00:58.883 8310 26488 I NearbyConnections: ClientProxy(147530679) ignoring onConnectionResult(1mhc, ERROR) because this client has no pending connections to the endpoint [CONTEXT service_id=54 ]
12-29 10:00:58.884 8310 22681 W Nearby : Method finished running after 830909 millis. [CONTEXT service_id=49 ]
12-29 10:00:58.884 8310 22681 W Nearby : ahds: ahds
12-29 10:00:58.884 8310 22681 W Nearby : at sun.misc.Unsafe.park(Native Method)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-29 10:00:58.884 8310 22681 W Nearby : at rrp.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:58.884 8310 22681 W Nearby : at java.lang.Thread.run(Thread.java:923)
12-29 10:00:58.884 8310 22681 W Nearby : Caused by: ahds
12-29 10:00:58.884 8310 22681 W Nearby : at ahdt.a(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:58.884 8310 22681 W Nearby : at ahdl.execute(:com.google.android.gms#204713047#20.47.13 (150406-344095733):0)
12-29 10:00:58.884 8310 22681 W Nearby : at ahjq.run(Unknown Source:4)
12-29 10:00:58.884 8310 22681 W Nearby : at ahdp.run(Unknown Source:0)
12-29 10:00:58.884 8310 22681 W Nearby : at rlt.c(:com.google.android.gms#204713047#20.47.13 (150406-344095733):6)
12-29 10:00:58.884 8310 22681 W Nearby : at rlt.run(:com.google.android.gms#204713047#20.47.13 (150406-344095733):7)
12-29 10:00:58.884 8310 22681 W Nearby : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-29 10:00:58.884 8310 22681 W Nearby : ... 3 more
12-29 10:00:58.892 26444 26444 I (NearbyReceiverService.kt:125)#onDisconnected: Stop advertising because nearby doesn't support reconnect
12-29 10:00:58.893 26444 26444 I (NearbyReceiverService.kt:187)#stopAdvertising: stop
12-29 10:00:58.894 26444 26444 D (NearbyReceiverService.kt:127)#onDisconnected: onDisconnected: 1mhc```
Please help.

Related

Calling KeGetCurrentThread() in DriverEntry() and inputing _KTHREAD Address in WinDbg gives (null) value for WaitPrcb member variable

OK so I have a kernel mode WDF device driver and in DriverEntry I've got two lines of code (see at the bottom). I then take the address displayed in DebugView by the DbgPrintEx statement then enter this command at the WinDbg command line as follows:
dt _KTHREAD 0xFFFFA80000050000
Gives the following output and at the bottom of this output shows WaitPrcb equal to (null):
lkd> dt _KTHREAD 00007ff69a380000
ntdll!_KTHREAD
+0x000 Header : _DISPATCHER_HEADER
+0x018 SListFaultAddress : 0x00000000`00000040 Void
+0x020 QuantumTarget : 0
+0x028 InitialStack : (null)
+0x030 StackLimit : (null)
+0x038 StackBase : 0x00000180`00000000 Void
+0x040 ThreadLock : 0xcd09b400`0eba1f0e
+0x048 CycleTime : 0x685421cd`4c01b821
+0x050 CurrentRunTime : 0x70207369
+0x054 ExpectedRunTime : 0x72676f72
+0x058 KernelStack : 0x6f6e6e61`63206d61 Void
+0x060 StateSaveArea : 0x6e757220`65622074 _XSAVE_FORMAT
+0x068 SchedulingGroup : 0x20534f44`206e6920 _KSCHEDULING_GROUP
+0x070 WaitRegister : _KWAIT_STATUS_REGISTER
+0x071 Running : 0x6f 'o'
+0x072 Alerted : [2] "de"
+0x074 SpareMiscFlag0 : 0y0
+0x074 ReadyTransition : 0y1
+0x074 ProcessReadyQueue : 0y1
+0x074 WaitNext : 0y1
+0x074 SystemAffinityActive : 0y0
+0x074 Alertable : 0y1
+0x074 UserStackWalkActive : 0y0
+0x074 ApcInterruptRequest : 0y0
+0x074 QuantumEndMigrate : 0y1
+0x074 UmsDirectedSwitchEnable : 0y0
+0x074 TimerActive : 0y1
+0x074 SystemThread : 0y1
+0x074 ProcessDetachActive : 0y0
+0x074 CalloutActive : 0y0
+0x074 ScbReadyQueue : 0y0
+0x074 ApcQueueable : 0y0
+0x074 ReservedStackInUse : 0y1
+0x074 UmsPerformingSyscall : 0y0
+0x074 ApcPendingReload : 0y1
+0x074 TimerSuspended : 0y1
+0x074 SuspendedWaitMode : 0y0
+0x074 Reserved : 0y00001010000 (0x50)
+0x074 MiscFlags : 0n168627502
+0x078 AutoAlignment : 0y0
+0x078 DisableBoost : 0y0
+0x078 UserAffinitySet : 0y1
[...]
+0x2c8 WaitPrcb : (null)
The following two lines of code are taken from DriverEntry. The question comes down to is what am I doing wrong and why is WaitPrcb (null) ?
1. _KTHREAD* pKthread = KeGetCurrentThread();
2. DbgPrintEx(DPFLTR_SYSTEM_ID, DPFLTR_ERROR_LEVEL, "[ProcessSwitch...] pKTHREAD = %p\n", pKthread);
This answer is just to address the comment by thomas and clarify what Josh Poley commented
Seeing a bunch of characters in ASCII printable range is a strong indicator that some thing is not Right
see below what is sitting in the dumped data
it is a QWORD and characters should be arranged considering Endianess but it is still a visible String
+0x048 CycleTime : 0x685421cd`4c01b821
+0x050 CurrentRunTime : 0x70207369
+0x054 ExpectedRunTime : 0x72676f72
+0x058 KernelStack : 0x6f6e6e61`63206d61 Void
+0x060 StateSaveArea : 0x6e757220`65622074 _XSAVE_FORMAT
+0x068 SchedulingGroup : 0x20534f44`206e6920 _KSCHEDULING_GROUP

Primary election isn't done after primary is killed on a MongoDB Cluster

I try to test fail over scenario of a mongoDB cluster. When I stopped the primary, I don't see any new primary election on my Java code's logs, and read/write operations are ignore and getting following:
No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=mongo1:30001, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}, ServerDescription{address=mongo2:30002, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=3215664, setName='rs0', canonicalAddress=mongo2:30002, hosts=[mongo1:30001], passives=[mongo2:30002, mongo3:30003], arbiters=[], primary='null', tagSet=TagSet{[]}, electionId=null, setVersion=1, lastWriteDate=Fri Mar 26 02:08:27 CET 2021, lastUpdateTimeNanos=91832460163658}, ServerDescription{address=mongo3:30003, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=3283858, setName='rs0', canonicalAddress=mongo3:30003, hosts=[mongo1:30001], passives=[mongo2:30002, mongo3:30003], arbiters=[], primary='null', tagSet=TagSet{[]}, electionId=null, setVersion=1, lastWriteDate=Fri Mar 26 02:08:27 CET 2021, lastUpdateTimeNanos=91832459878686}]}. Waiting for 30000 ms before timing out
I am using the following config:
var cfg = {
"_id": "rs0",
"protocolVersion": 1,
"version": 1,
"members": [
{
"_id": 0,
"host": "mongo1:30001",
"priority": 4
},
{
"_id": 1,
"host": "mongo2:30002",
"priority": 3
},
{
"_id": 2,
"host": "mongo3:30003",
"priority": 2,
}
]
};
rs.initiate(cfg, { force: true });
rs.secondaryOk();
db.getMongo().setReadPref('primary');
rs.isMaster() returns this:
{
"hosts" : [
"mongo1:30001"
],
"passives" : [
"mongo2:30002",
"mongo3:30003"
],
"setName" : "rs0",
"setVersion" : 1,
"ismaster" : true,
"secondary" : false,
"primary" : "mongo1:30001",
"me" : "mongo1:30001",
"electionId" : ObjectId("7fffffff0000000000000017"),
"lastWrite" : {
"opTime" : {
"ts" : Timestamp(1616719738, 1),
"t" : NumberLong(23)
},
"lastWriteDate" : ISODate("2021-03-26T00:48:58Z"),
"majorityOpTime" : {
"ts" : Timestamp(1616719738, 1),
"t" : NumberLong(23)
},
"majorityWriteDate" : ISODate("2021-03-26T00:48:58Z")
},
"maxBsonObjectSize" : 16777216,
"maxMessageSizeBytes" : 48000000,
"maxWriteBatchSize" : 100000,
"localTime" : ISODate("2021-03-26T00:49:08.019Z"),
"logicalSessionTimeoutMinutes" : 30,
"connectionId" : 28,
"minWireVersion" : 0,
"maxWireVersion" : 8,
"readOnly" : false,
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1616719738, 1),
"signature" : {
"hash" : BinData(0,"/+QXGSyYY+M/OXbZ1UixjrDOVz4="),
"keyId" : NumberLong("6942620613131370499")
}
},
"operationTime" : Timestamp(1616719738, 1)
}
Here what I see is hosts list has primary node and passives list have the secondries. I don't know when is the case that all nodes are considered under hosts in a cluster setup, so passives will be empty. The only related info I found is priority of the secondries should not be 0. Otherwise they won't be considered as candidate for the primary election.
"mongo1:30001"
],
"passives" : [
"mongo2:30002",
"mongo3:30003"
],...
From the docs:
isMaster.passives
An array of strings in the format of "[hostname]:[port]" listing all members of the replica set which have a members[n].priority of 0.
This field only appears if there is at least one member with a members[n].priority of 0.
Those nodes have been set to priority 0 somehow, and will therefore never attempt to become primary.

mongo-java-driver how to create mongo's user on doesn't exists database yet

Can i create the first user on mongodb by mongo-java-driver? i tried but got this error.
com.mongodb.CommandFailureException: { "serverUsed" : "localhost:27017" , "ok" : 0.0 , "errmsg" : "Authentication failed." , "code" : 18 , "codeName" : "AuthenticationFailed"}

Missing Containers Cmdlet

I created the new Server Core (Windows 2016). I can't find the all container cmdlet in powershell. I did Uninstall/installed the containers feature but still missing all cmdlet. How do i get containers cmdlet in powershell?
Here is my server info.
WindowsBuildLabEx : 16299.15.amd64fre.rs3_release.170928-1534
WindowsCurrentVersion : 6.3
WindowsEditionId : ServerDatacenterACor
WindowsInstallationType : Server Core
WindowsInstallDateFromRegistry : 28/4/2018 12:41:19 PM
WindowsProductId : 00395-60000-00001-AA842
WindowsProductName : Windows Server Datacenter
WindowsRegisteredOrganization :
WindowsRegisteredOwner : Windows User
WindowsSystemRoot : C:\Windows
WindowsVersion : 1709
BiosCharacteristics : {3, 9, 15, 16...}
BiosBIOSVersion : {VRTUAL - 1, Hyper-V UEFI Release v2.5, Microsoft - 100032}
BiosBuildNumber :
BiosCaption : Hyper-V UEFI Release v2.5
BiosCodeSet :
BiosCurrentLanguage :
BiosDescription : Hyper-V UEFI Release v2.5
BiosEmbeddedControllerMajorVersion : 255
BiosEmbeddedControllerMinorVersion : 255
BiosFirmwareType : Uefi
BiosIdentificationCode :
BiosInstallableLanguages :
BiosInstallDate :
BiosLanguageEdition :
BiosListOfLanguages :
BiosManufacturer : Microsoft Corporation
BiosName : Hyper-V UEFI Release v2.5
BiosOtherTargetOS :
BiosPrimaryBIOS : True
BiosReleaseDate : 22/8/2017 8:00:00 AM
BiosSeralNumber : 8355-6248-8581-2148-3845-5374-58
BiosSMBIOSBIOSVersion : Hyper-V UEFI Release v2.5
BiosSMBIOSMajorVersion : 2
BiosSMBIOSMinorVersion : 4
BiosSMBIOSPresent : True
BiosSoftwareElementState : Running
BiosStatus : OK
BiosSystemBiosMajorVersion : 2
BiosSystemBiosMinorVersion : 5
BiosTargetOperatingSystem : 0
BiosVersion : VRTUAL - 1
CsAdminPasswordStatus : Unknown
CsAutomaticManagedPagefile : True
CsAutomaticResetBootOption : True
CsAutomaticResetCapability : True
CsBootOptionOnLimit :
CsBootOptionOnWatchDog :
CsBootROMSupported : True
CsBootStatus : {0, 0, 0, 127...}
CsBootupState : Normal boot
CsCaption : WIN16DCORE
CsChassisBootupState : Safe
CsChassisSKUNumber :
CsCurrentTimeZone : 480
CsDaylightInEffect :
CsDescription : AT/AT COMPATIBLE
CsDNSHostName : WIN16DCore
CsDomain : WORKGROUP
CsDomainRole : StandaloneServer
CsEnableDaylightSavingsTime : True
CsFrontPanelResetStatus : Unknown
CsHypervisorPresent : True
CsInfraredSupported : False
CsInitialLoadInfo :
CsInstallDate :
CsKeyboardPasswordStatus : Unknown
CsLastLoadInfo :
CsManufacturer : Microsoft Corporation
CsModel : Virtual Machine
CsName : WIN16DCORE
CsNetworkAdapters : {vEthernet - 1}
CsNetworkServerModeEnabled : True
CsNumberOfLogicalProcessors : 1
CsNumberOfProcessors : 1
CsProcessors : {Intel(R) Core(TM) i3-2100 CPU # 3.10GHz}
CsOEMStringArray : {[MS_VM_CERT/SHA1/9b80ca0d5dd061ec9da4e494f4c3fd1196270c22],
00000000000000000000000000000000, To be filled by OEM}
CsPartOfDomain : False
CsPauseAfterReset : -1
CsPCSystemType : Desktop
CsPCSystemTypeEx : Desktop
CsPowerManagementCapabilities :
CsPowerManagementSupported :
CsPowerOnPasswordStatus : Unknown
CsPowerState : Unknown
CsPowerSupplyState : Safe
CsPrimaryOwnerContact :
CsPrimaryOwnerName : Windows User
CsResetCapability : Other
CsResetCount : -1
CsResetLimit : -1
CsRoles : {LM_Workstation, LM_Server, NT, Server_NT}
CsStatus : OK
CsSupportContactDescription :
CsSystemFamily : Virtual Machine
CsSystemSKUNumber : None
CsSystemType : x64-based PC
CsThermalState : Safe
CsTotalPhysicalMemory : 5082476544
CsPhyicallyInstalledMemory : 4964352
CsUserName :
CsWakeUpType : PowerSwitch
CsWorkgroup : WORKGROUP
OsName : Microsoft Windows Server Datacenter
OsType : WINNT
OsOperatingSystemSKU : 145
OsVersion : 10.0.16299
OsCSDVersion :
OsBuildNumber : 16299
OsHotFixes : {KB4099989, KB4093112}
OsBootDevice : \Device\HarddiskVolume2
OsSystemDevice : \Device\HarddiskVolume4
OsSystemDirectory : C:\Windows\system32
OsSystemDrive : C:
OsWindowsDirectory : C:\Windows
OsCountryCode : 65
OsCurrentTimeZone : 480
OsLocaleID : 4809
OsLocale : en-SG
OsLocalDateTime : 29/4/2018 1:35:42 PM
OsLastBootUpTime : 29/4/2018 1:23:23 PM
OsUptime : 00:12:18.3221697
OsBuildType : Multiprocessor Free
OsCodeSet : 1252
OsDataExecutionPreventionAvailable : True
OsDataExecutionPrevention32BitApplications : True
OsDataExecutionPreventionDrivers : True
OsDataExecutionPreventionSupportPolicy : OptOut
OsDebug : False
OsDistributed : False
OsEncryptionLevel : 256
OsForegroundApplicationBoost : Maximum
OsTotalVisibleMemorySize : 4963356
OsFreePhysicalMemory : 4239756
OsTotalVirtualMemorySize : 6536220
OsFreeVirtualMemory : 5858416
OsInUseVirtualMemory : 677804
OsTotalSwapSpaceSize :
OsSizeStoredInPagingFiles : 1572864
OsFreeSpaceInPagingFiles : 1572864
OsPagingFiles : {C:\pagefile.sys}
OsHardwareAbstractionLayer : 10.0.16299.371
OsInstallDate : 28/4/2018 8:41:19 PM
OsManufacturer : Microsoft Corporation
OsMaxNumberOfProcesses : 4294967295
OsMaxProcessMemorySize : 137438953344
OsMuiLanguages : {en-US}
OsNumberOfLicensedUsers : 0
OsNumberOfProcesses : 66
OsNumberOfUsers : 2
OsOrganization :
OsArchitecture : 64-bit
OsLanguage : en-US
OsProductSuites : {TerminalServices, TerminalServicesSingleSession}
OsOtherTypeDescription :
OsPAEEnabled :
OsPortableOperatingSystem : False
OsPrimary : True
OsProductType : Server
OsRegisteredUser : Windows User
OsSerialNumber : 00395-60000-00001-AA842
OsServicePackMajorVersion : 0
OsServicePackMinorVersion : 0
OsStatus : OK
OsSuites : {TerminalServices, TerminalServicesSingleSession}
OsServerLevel : ServerCore
KeyboardLayout : en-US
TimeZone : (UTC+08:00) Kuala Lumpur, Singapore
LogonServer :
PowerPlatformRole : Desktop
HyperVisorPresent : True
HyperVRequirementDataExecutionPreventionAvailable :
HyperVRequirementSecondLevelAddressTranslation :
HyperVRequirementVirtualizationFirmwareEnabled :
HyperVRequirementVMMonitorModeExtensions :
DeviceGuardSmartStatus : Off
DeviceGuardRequiredSecurityProperties :
DeviceGuardAvailableSecurityProperties :
DeviceGuardSecurityServicesConfigured :
DeviceGuardSecurityServicesRunning :
DeviceGuardCodeIntegrityPolicyEnforcementStatus :
DeviceGuardUserModeCodeIntegrityPolicyEnforcementStatus :
Here is cmdlet to find the container cmdlet and result
Get-WindowsFeature -Name Containers
Display Name Name Install State
------------ ---- -------------
[X] Containers Containers Installed
Get-InstalledModule
Version Name Repository Description
------- ---- ---------- -----------
1.0.0.4 DockerMsftProvider PSGallery PowerShell module with commands for discovering,...
1.0.154 DockerPowershell PSGallery Adds cmdlets to work with the Docker cli.
get-command | where Source -EQ "*cont*"
Empty

Getting USB Version through WMI Classes

I am trying to query the USB Device for the USB Descriptor which will store information regarding the USB Version, Device ID, PID, VID etc. I only need the USB Version.
Here is the PowerShell Code so far:
[System.Reflection.Assembly]::Load("System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$Man = New-Object System.Management.ManagementClass("Win32_USBHub")
[System.Management.ManagementObjectCollection]$Devs = $Man.GetInstances()
echo $Devs
The output I am getting is:
__GENUS : 2
__CLASS : Win32_USBHub
__SUPERCLASS : CIM_USBHub
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_USBHub.DeviceID="USB\\VID_0781&PID_5567\\4C530000120619102080"
__PROPERTY_COUNT : 28
__DERIVATION : {CIM_USBHub, CIM_USBDevice, CIM_LogicalDevice, CIM_LogicalElement...}
__SERVER : APPS-SD-AUTO-PC
__NAMESPACE : root\cimv2
__PATH : \\APPS-SD-AUTO- PC\root\cimv2:Win32_USBHub.DeviceID="USB\\VID_0781&PID_5567\\4C530000120619102080"
Availability :
Caption : USB Mass Storage Device
ClassCode :
ConfigManagerErrorCode : 0
ConfigManagerUserConfig : False
CreationClassName : Win32_USBHub
CurrentAlternateSettings :
CurrentConfigValue :
Description : USB Mass Storage Device
DeviceID : USB\VID_0781&PID_5567\4C530000120619102080
ErrorCleared :
ErrorDescription :
GangSwitched :
InstallDate :
LastErrorCode :
Name : USB Mass Storage Device
NumberOfConfigs :
NumberOfPorts :
PNPDeviceID : USB\VID_0781&PID_5567\4C530000120619102080
PowerManagementCapabilities :
PowerManagementSupported :
ProtocolCode :
Status : OK
StatusInfo :
SubclassCode :
SystemCreationClassName : Win32_ComputerSystem
SystemName : APPS-SD-AUTO-PC
USBVersion :
Here USBVersion is coming as an empty field. Can anyone suggest a solution?
I have tried with Win32_usbDeviceController but that is also returning an empty field.