Facts
Facts: Your Computer's Facts: `Get-CimInstance`, Event Logs: Why Did It Restart?.
Updated
- Your Computer's Facts: `Get-CimInstance` (Journeyman): Get-CimInstance asks Windows' own catalog of facts about the computer, one class at a time, such as Win32_OperatingSystem for the Windows version and the last restart, Win32_LogicalDisk for the disks and Win32_Battery for the battery, and a calculated property turns its bytes into gigabytes.
- Event Logs: Why Did It Restart? (Journeyman): Windows writes what happens to it in event logs, and Get-WinEvent -FilterHashtable finds the events you want by log, event ID, level and start time, so the five restart IDs, 41, 1074, 6005, 6006 and 6008, tell a planned restart from a crash or a power cut.