Created
May 25, 2017 05:02
-
-
Save stknohg/b859b864af37ea2c5debfed496cbf6ae to your computer and use it in GitHub Desktop.
OSの起動と停止のイベントログを抽出するコマンド
This file contains 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
# | |
# よくわかりませんが何かの役に立つことがあるかもしれないらしいですね... | |
# PowerShell 2.0以降で動作します。 | |
# | |
Get-WinEvent -LogName System -FilterXPath "*[System[Provider[@Name='Microsoft-Windows-Kernel-General'] and (EventID=12 or EventID=13)]]" | Select-Object TimeCreated, Id, Message | Format-Table -Autosize |
This file contains 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
# | |
# クリップボードに内容をコピーする場合 | |
# $OutputEncoding を変更しておかないと日本語が文字化けするので変えておく必要があります。 | |
# | |
$OutputEncoding = [Text.Encoding]::Default | |
Get-WinEvent -LogName System -FilterXPath "*[System[Provider[@Name='Microsoft-Windows-Kernel-General'] and (EventID=12 or EventID=13)]]" | Select-Object TimeCreated, Id, Message | Format-Table -Autosize | clip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment