Managing and enforcing security policies for devices and apps to protect organizational data through Intune
You can use Get-ComputerInfo cmdlet to get the data you are looking for. However, there may be faster options.
(Get-ComputerInfo).OsLastBootUpTime
If you want to compare it to the current time to do some logic on how long it has been up.
$BootUpTime = (Get-ComputerInfo).OsLastBootUpTime
$LocalTime = (Get-ComputerInfo).OsLocalDateTime
$UpTime = $LocalTime - $BootUpTime