How To Get the System Uptime

There are many ways to obtain the system uptime from Windows GUI:

  • Task Manager, Performance , Up Time. 
  • From the command prompt using the command prompt systeminfo ( system boot time).

But why don’t use Powershell or BaSH?

POWERSHELL

If you are using PowerShell version later than 5.1


BASH

The result looks similar, but what if we want to get from PowerShell just the up time instead the last boot up time?

The New-TimeSpan cmdlet will help us to achieve what we really want:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.