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

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -