powershell - Get-EventLog -After query -
when run below command on powershell 1 one, getting expected result. when run ps script, not getting output.
$startdate = get-date write-eventlog -logname application -source "msiinstaller" -eventid 11707 -message "product: installation operation completed successfully." get-eventlog application -after "$startdate" -source "msiinstaller"
what missing?
it's accuracy of event log, when run in script, happens in same second.
try this:
$startdate = get-date write-eventlog -logname application -source "msiinstaller" -eventid 11707 -message "product: installation operation completed successfully." start-sleep(1) get-eventlog application -after "$startdate" -source "msiinstaller"
Comments
Post a Comment