When did i boot my computer?

I use a time logger at work, but alot of times i forget what time i started, so to get the computer boot time, i have created a little powershell function

Posted by Carl Berg on Mon, Feb 29, 2016 | Tags powershell

I use a time logger at work, but alot of times i forget what time i started, so to get the computer boot time, i have created a little powershell function i have added to my profile:

function boottime 
{ 
  $bootTime = (Get-WmiObject Win32_OperatingSystem).LastBootUpTime
  [System.Management.ManagementDateTimeConverter]::ToDateTime($bootTime) 
}