General Check if Last Boot was from Fast Startup, Hibernate, Restart or Shutdown in Windows 11

  • Thread starter Thread starter Brink
  • Start date Published: Start date Updated Updated:

Power_banner.webp

This tutorial will show you how to check if the last boot was from a hybrid shutdown (fast startup), full shutdown or restart, or resume from hibernate in Windows 10 and Windows 11.

Fast startup (aka: hiberboot, hybrid boot, or hybrid shutdown) is turned on by default in Windows and is a setting that helps your PC start up faster after shutdown. Even faster than hibernate.

Hibernate is a power-saving state designed primarily for laptops, and might not be available for all PCs. Hibernate uses less power than sleep and when you start up the PC again, you’re back to where you left off (though not as fast as sleep). Use hibernation when you know that you won't use your laptop or tablet for an extended period and won't have an opportunity to charge the battery during that time.

A restart will sign out all users, shut down the computer, and then automatically reboot the computer. If you have Automatically save my restartable apps and restart them when I sign back in turned on, it will restore open apps that have registered for application restart after you restart or shutdown.

A full shutdown will close all apps, sign out all users, and completely turn off the PC. A full shutdown is good to use if you don't plan to use your PC for an extended period and wanted to completely power off the PC. If you have Automatically save my restartable apps and restart them when I sign back in turned on, it will restore open apps that have registered for application restart after you restart or shutdown.



Here's How:

1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Copy and paste the appropriate command below into Windows Terminal, and press Enter. (see screenshots below)

Windows PowerShell
Get-WinEvent -ProviderName Microsoft-Windows-Kernel-boot -MaxEvents 10 | where-object -Property id -eq "27"

OR​

Command Prompt
powershell -command "Get-WinEvent -ProviderName Microsoft-Windows-Kernel-boot -MaxEvents 10 | where-object -Property id -eq "27""


3 Look for The boot type was under the shutdown time period you want, and compare it with the table below.

Boot Type​
Description​
0x0restart OR cold boot from full shutdown
0x1hybrid boot (fast startup)
0x2resume from hibernation

PowerShell.webp


Command_Prompt.webp



That's it,
Shawn Brink

 
Last edited:
Some users have complained that Fast Startup doesn't log the restart event.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
here. i've merged this with

so the output log txt on your desktop will be similar to this:
1776022669865.webp

if using this code:
Code:
# Generate timestamp for the file name
$timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"

# Build the output file path on the user's Desktop
$desktopPath = [Environment]::GetFolderPath("Desktop")
$outputFile = Join-Path $desktopPath "Power Cycle Causes ($timestamp).txt"

# Get boot type events (Kernel-Boot ID 27)
$bootEvents = Get-WinEvent -FilterHashtable @{
    LogName      = 'System'
    ProviderName = 'Microsoft-Windows-Kernel-Boot'
    Id           = 27
} | Sort-Object TimeCreated

# Get all relevant power/boot/shutdown events
$powerEvents = Get-WinEvent -FilterHashtable @{
    LogName = 'System'
    Id      = 1, 12, 27, 41, 1074, 6005, 6006, 6008, 6605
} | Sort-Object TimeCreated

function Get-BootTypeText {
    param($value)
    switch ($value) {
        0 { return "0x0: This was a Cold Boot via Full Shutdown or a Restart" }
        1 { return "0x1: Hybrid Boot (Fast Startup)" }
        2 { return "0x2: Resume from Hibernation" }
        default { return "Boot type unavailable" }
    }
}

# Build sessions
$sessions = @()

# --- SESSION 1: ALWAYS include newest events from last boot to now ---
$latestBoot = $bootEvents | Select-Object -Last 1

if ($latestBoot) {
    $latestEvents = $powerEvents | Where-Object {
        $_.TimeCreated -ge $latestBoot.TimeCreated
    }

    if ($latestEvents.Count -gt 0) {
        $sessions += [PSCustomObject]@{
            BootEvent = $latestBoot
            Events    = $latestEvents
        }
    }
}

# --- OLDER SESSIONS ---
for ($i = 0; $i -lt $bootEvents.Count - 1; $i++) {

    $boot     = $bootEvents[$i]
    $nextBoot = $bootEvents[$i + 1]

    $eventsInRange = $powerEvents | Where-Object {
        $_.TimeCreated -ge $boot.TimeCreated -and $_.TimeCreated -lt $nextBoot.TimeCreated
    }

    if ($eventsInRange.Count -gt 0) {
        $sessions += [PSCustomObject]@{
            BootEvent = $boot
            Events    = $eventsInRange
        }
    }
}

# Sort sessions newest → oldest
$sessions = $sessions | Sort-Object { $_.BootEvent.TimeCreated } -Descending

# Build report
$report = ""

foreach ($session in $sessions) {

    $bootTypeValue = $session.BootEvent.Properties[0].Value
    $bootTypeText  = Get-BootTypeText $bootTypeValue

    $report += @"
Boot Type:
$bootTypeText

------------------------------------------------------------

Event Log Entries:

"@

    foreach ($ev in $session.Events | Sort-Object TimeCreated -Descending) {
        $formatted = $ev | Format-List Id, LevelDisplayName, TimeCreated, Message | Out-String
        $report += $formatted + "`n"
    }

    $report += "`n`n"
}

$report | Out-File -FilePath $outputFile -Encoding UTF8
Write-Host "Report saved to: $outputFile"


OR

similar to this:
1776022826285.webp


if using this code:

Code:
# Get boot type events (Kernel-Boot ID 27)
$bootEvents = Get-WinEvent -FilterHashtable @{
    LogName      = 'System'
    ProviderName = 'Microsoft-Windows-Kernel-Boot'
    Id           = 27
} | Sort-Object TimeCreated

# Get ALL relevant events (for correct session building)
$allEvents = Get-WinEvent -FilterHashtable @{
    LogName = 'System'
    Id      = 1, 12, 27, 41, 1074, 6005, 6006, 6008, 6605
} | Sort-Object TimeCreated

function Get-BootTypeText {
    param($value)
    switch ($value) {
        0 { return "0x0: Cold Boot / Restart" }
        1 { return "0x1: Hybrid Boot (Fast Startup)" }
        2 { return "0x2: Resume from Hibernation" }
        default { return "Unknown Boot Type" }
    }
}

# Build sessions
$sessions = @()

# Newest boot session
$latestBoot = $bootEvents | Select-Object -Last 1

if ($latestBoot) {
    $latestEvents = $allEvents | Where-Object {
        $_.TimeCreated -ge $latestBoot.TimeCreated
    }

    $sessions += [PSCustomObject]@{
        BootEvent = $latestBoot
        Events    = $latestEvents
    }
}

# Older sessions
for ($i = 0; $i -lt $bootEvents.Count - 1; $i++) {

    $boot     = $bootEvents[$i]
    $nextBoot = $bootEvents[$i + 1]

    $eventsInRange = $allEvents | Where-Object {
        $_.TimeCreated -ge $boot.TimeCreated -and $_.TimeCreated -lt $nextBoot.TimeCreated
    }

    $sessions += [PSCustomObject]@{
        BootEvent = $boot
        Events    = $eventsInRange
    }
}

# Sort newest → oldest
$sessions = $sessions | Sort-Object { $_.BootEvent.TimeCreated } -Descending

# Build GridView rows
$rows = @()

foreach ($session in $sessions) {

    $bootTypeValue = $session.BootEvent.Properties[0].Value
    $bootTypeText  = Get-BootTypeText $bootTypeValue
    $bootTime      = $session.BootEvent.TimeCreated

    $groupName = "$($bootTime.ToString('yyyy-MM-dd HH:mm:ss'))  |  $bootTypeText"

    # Add header row
    $rows += [PSCustomObject]@{
        Group       = $groupName
        Type        = "BOOT"
        TimeCreated = $bootTime
        EventID     = ""
        Message     = ""
    }

    # Only output pertinent power events
    $powerEventsOnly = $session.Events | Where-Object {
        $_.Id -in 41, 1074, 6006, 6008, 6605
    } | Sort-Object TimeCreated -Descending

    if ($powerEventsOnly.Count -eq 0) {
        $rows += [PSCustomObject]@{
            Group       = $groupName
            Type        = "INFO"
            TimeCreated = ""
            EventID     = ""
            Message     = "(No power events for this boot session)"
        }
        continue
    }

    foreach ($ev in $powerEventsOnly) {
        $rows += [PSCustomObject]@{
            Group       = $groupName
            Type        = "EVENT"
            TimeCreated = $ev.TimeCreated
            EventID     = $ev.Id
            Message     = $ev.Message
        }
    }
}

# Output to collapsible GridView
$rows | Out-GridView -Title "Power Events by Boot Session (Collapsible by Group Column)"

# Save the exact same rows to a text file
$rows | Format-Table -AutoSize | Out-String | Out-File -FilePath $outputFile -Encoding UTF8

Write-Host "Report saved to: $outputFile"
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Back
Top Bottom