Can someone please tell me why there is a discrepancy when we fetch the up-time of a VM.
sys.uptime.latest & $_.runtime.bootTime shows same results (36 days) but its quite different from UP-Time mentioned in the task manager (2 days) of the VM (See screenshot).
I suspect this might be due to the difference in the last reboot of the VM and the last reboot of the guest OS.
The last guest OS reboot should be logged in the guest OS eventlog.
Also see my earlier answer in this thread.