The below bit of PowrShell will return the uptime and last boot time stamp of a remote Windows computer.
Change the $server variable as needed.
#
# Get Uptime
#
$server = "MyServer01"
$os = gwmi Win32_OperatingSystem -computerName $server
$boottime = $OS.converttodatetime($OS.LastBootUpTime)
$uptime = New-TimeSpan (get-date $boottime)
$uptime_days = [int]$uptime.days
write-host "LAST BOOT TIME = " $boottime
write-host "UPTIME (DAYS) = " $uptime_days
it does not work in windows powershell 5.1