Read the shutdown and restart events
**1074** is a clean shutdown with the requesting process and user, **6006** and **6005** mark the clean intervals, and **41** reports an unexpected power loss.
Get-WinEvent -FilterHashtable @{LogName='System';Id=1074,6005,6006,6008,41} -MaxEvents 20 | Select-Object TimeCreated,Id,ProviderName,Message | Format-List