PowerShellでWindowsイベントログをtailする
code:tail_eventlog.ps1
$idx = (get-eventlog -LogName Security -Newest 1).Index
while ($true)
{
start-sleep -Seconds 1
$idx2 = (Get-EventLog -LogName Security -newest 1).index
get-eventlog -logname security -newest ($idx2 - $idx) | sort index
$idx = $idx2
}