Fleet’s built-in queries for collecting and storing important device information.
Apple
Linux
Windows
ChromeOS
Uptime
Retrieves the amount time passed since a device's last boot.
SELECT * FROM uptime LIMIT 1
$os = Get-CimInstance -ClassName 'Win32_OperatingSystem' $lastBoot = $os.LastBootUpTime $uptimeSpan = (Get-Date) - $lastBoot $seconds = [math]::Floor($uptimeSpan.TotalSeconds) $pretty = '' if ($uptimeSpan.Days -gt 0) { $pretty += "$($uptimeSpan.Days) days, " } $pretty += "$($uptimeSpan.Hours) hours, $($uptimeSpan.Minutes) minutes, $($uptimeSpan.Seconds) seconds" [PSCustomObject]@{
seconds = $seconds
pretty = $pretty
} | Format-Table -AutoSize
PowerShell commands are currently work in progress, contributions welcome.
Vitals