-
- List the last 50 entries in the System log using Get-WinEvent
- Output 2 blank lines
- List the last 50 entries in the Application log using Get-EventLog, sorting by Index
- Output 2 blank lines
Using pipes, list the entries in the Application log using Get-EventLog that were written/generated in the last 30 days, sorting by Index
get-WinEvent -log system -maxevents 50
Write-host
Write-host
get-Eventlog -log application -newest 50 | sort-object -property index
Write-host
Write-host
$ara = @(get-eventlog -log application -newest 50)
foreach ( $element in $ara )
{
$val = $element.index.ToString()
Write-Host $val
}