Determine Windows system runtime using PowerShell

We have already reported how you can determine the Windows system runtime using the Windows Task Manager or the standard Windows command “Sysinfo” . Also that the Windows operating time that is displayed in Windows Task Manager does not match the actual run time. You can read this in the entry ” Windows operating time (runtime) is not correct in the Task Manager for Windows 10 “.

Today we would like to show you another variant of how you can query the runtime of your Windows system using PowerShell . This is not limited to Windows 10, by the way, it works on all Windows operating systems that support Windows PowerShell. This also applies to Windows Server operating systems such as Windows Server 2012 R2 or Windows Server 2016.

Determine runtime using the PowerShell command

With the following command you can read out the Windows system runtime via PowerShell:

((get-date) – (gcim Win32_OperatingSystem) .LastBootUptime) .ToString (‘g’)

This command calculates the system runtime from the current date and the last boot time, i.e. the last Windows start, and displays it exactly. You can see from the following figure that this runtime corresponds exactly to the operating time that is displayed in the Windows Task Manager.

Again we find a very helpful PowerShell command . We have reported many other PowerShell commands in the past , which we would like to introduce to you below. Maybe one or the other interesting PowerShell command is there for you. If you know any other PowerShell tips and tricks, it would be nice if you would leave them as a comment at the end of this post.

– Create Windows 10 system restore point with PowerShell

Shut down and restart Windows with PowerShell commands – Repair Windows component stores with DISM and PowerShell commands
– Switch off UAC (user account control ) via PowerShell or registry in Windows 10
– PowerShell command to deactivate the firewall