Created
March 22, 2023 12:51
-
-
Save dougwaldron/2d0aa7da6d7d7ccdaafa085880276fff to your computer and use it in GitHub Desktop.
PowerShell commands to show when the computer last turned off and then on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Last time system was turned off | |
Get-WinEvent -MaxEvents 3 -FilterHashTable @{ProviderName='Microsoft-Windows-Kernel-Power';LogName='System'} | |
# Last time system was turned on | |
Get-WinEvent -MaxEvents 1 -FilterHashTable @{ProviderName='Microsoft-Windows-Power-Troubleshooter';LogName='System'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment