Currently browsing tag

uptime

Get-Uptime

Here’s a simple function to get a “readable” value of the uptime for the local computer (by default, but there’s a ‘Server’ parameter), and the last boot date/time.

Get-UptimeDays | Get-Uptime

Get-UptimeDays

Get the localhost uptime, in days Function Get-UptimeDays() { $lastBootUpTimeWMIObject = (Get-WmiObject -ComputerName $env:computername -Query ‘SELECT LastBootUpTime FROM Win32_OperatingSystem’) $lastBootUpDate = Get-Date …

Scroll to Top