Uptime PowerShell Script / Command

Linux / Unix users are accustomed to issuing an uptime command and being returned with the current systems duration since last boot.  Windows on the other hand, does not have such a native command (that I am aware of) – placing this script in your path can yield the same results as the nix’ equivalent in a Wintel environment.

// uptime.ps1
(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime

About the author

Lima is the visual nautical indicator for "stop instantly."

Leave a Reply