从PowerShell-Server 2003创建拉取事件的时间

从PowerShell-Server 2003创建拉取事件的时间,powershell,Powershell,我正在Windows 2003服务器上尝试使用此power shell 1脚本提取事件时间 正确的语法是什么 $actions = (Get-EventLog -LogName "Application" -Message "*Succeeded*" -After (Get-Date).AddMinutes(-80)) if ($actions){ ForEach($action in $actions){ $Result = "Done - Job COMPLETED

我正在Windows 2003服务器上尝试使用此power shell 1脚本提取事件时间

正确的语法是什么

$actions = (Get-EventLog -LogName "Application" -Message "*Succeeded*" -After (Get-Date).AddMinutes(-80))

if ($actions){
    ForEach($action in $actions){
        $Result = "Done - Job COMPLETED OK at ***** EVENT TIME HERE *****"
        Write-Host $Result
        Exit 0
    }

更改为
“完成-作业在******事件时间完成正常”
“完成-作业在$($action.TimeGenerated)完成正常”
啊-谢谢!现在好了!