Windows 10 and Boot up time
So since windows 10 there is now yet another basic windows functionality broken.
The option to have windows boot up rapidly, or FastBoot as it is commonly known, breaks the notion that the computer has been restarted.
Weird hybrid mode.
In fact what is happening, unless a software update is scheduled, it does a weird hybrid of sleep and hibernate modes, in order to speed up the startup time of your machine.
Which, in turn causes your computer to lie, when you interrogate the WMI service (win32_operatingsystem class, / lastbootuptime) to find out it was only the last time a complete reboot was done (and not that soft quick boot we just mentioned)
However, the power has indeed been cut to the CPU!!!
However, the power has indeed been cut to the CPU!!!
Powershell to the Rescue! (well actually the Event log)
Can I ask Powershell for the truth?
Fortunately yes. But only because you can query the "Get-WinEvent" interface:
#This gives the REAL forced reboot date/time
( Get-WinEvent -ProviderName Microsoft-Windows-Kernel-Boot | ? {$_.Message -like '*boot type was 0x0*'} | sort TimeCreated -Descending)[0].TimeCreated
Versus (and it's abvious the operator changes everything)
#This will indicate the last return from sleep/hibernate or any other pseudo/not quite real reboot time
( Get-WinEvent -ProviderName Microsoft-Windows-Kernel-Boot | ? {$_.Message -Notlike '*boot type was 0x0*'} | sort TimeCreated -Descending)[0].TimeCreated
Your mileage may vary and there may be other ways to do this, but for the moment, this works!
HTH
JP
No comments:
Post a Comment