Here is a Powershell script to find out when is the last time computer clean shutdown
get-winevent -FilterHashtable @{ ProviderName = 'user32' ; id =1074 } -MaxEvents 1|ft -wrap
Example of run result

From
ลงเรื่องสุ่มๆที่สนใจหรืออยากเก็บไว้อ้างอิง
Here is a Powershell script to find out when is the last time computer clean shutdown
get-winevent -FilterHashtable @{ ProviderName = 'user32' ; id =1074 } -MaxEvents 1|ft -wrap
Example of run result
From
PowerShell to find out when a computer was last shutdown cleanly and why. Example is from AVD auto shutdown.
— Guy Leech (@guyrleech) October 19, 2024
get-winevent -FilterHashtable @{ ProviderName = 'user32' ; id =1074 } -MaxEvents 1|ft -wrap pic.twitter.com/3WhIWIgaTg