Summary: Learn how to get the last boot time for your computer.
How can I find the last boot time for my computer by using Windows PowerShell?
In Windows PowerShell 3.0, use the Get-CimInstance cmdlet, and select the LastBootUptime property from the Win32_Operatingsystem WMI class:
PS C:\> Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime
csname lastbootuptime
—— ————–
EDLT 3/22/2013 11:27:01 AM
In Windows PowerShell 2.0 and Windows PowerShell 1.0, use the Get-WmiObject cmdlet, and then translate the returned date to a readable format:
PS C:\> Get-WmiObject win32_operatingsystem | select csname, @{LABEL=’LastBootUpTime’
;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}
csname LastBootUpTime
—— ————–
EDLT 3/22/2013 11:27:01 AM
0 comments