Skip to Content
PowerShellSystem Uptime

System Uptime

Returns the time elapsed since the last system boot.

Script

(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime

Returns a TimeSpan object showing days, hours, minutes, and seconds since the last reboot.

Last updated on