Is there anything wrong with these codes? I am trying to list the event ID 1074. It runs well locally but not on the remote pc. It takes more than 10 mins.
Function whoshutdown($ComputerName = "."){
$date=(Get-Date).AddDays(-7)
Get-Eventlog -Logname System -computer $ComputerName -After $date `
| Where-Object {$_.EventId -eq ’1074′} `
| Format-list TimeWritten,EventID, Message | more
}