01-17-2013 09:57 PM
Hi There
I'm running the below command. However it returns more than the last 12 hours.
Get-BEJobHistory -JobStatus Error -FromStartTime (Get-Date).AddHours(-12) | ft -auto
Any help with would be great?
Cheers,
Brett
Solved! Go to Solution.
01-20-2013 01:51 PM
However this works
01-17-2013 10:27 PM
Have you tried this?
$a = (Get-Date).AddHours(-12)
Get-BEJobHistory -JobStatus Error -FromStartTime $a | ft -auto
If the above also does not work, try filtering it another way.
$a = (Get-Date).AddHours(-12)
Get-BEJobHistory -JobStatus Error | where-object {($_.StartTime > $a)} | ft -auto
01-20-2013 01:33 PM
Both of these don't work. The first comes be the last couple of months of jobs and the second one I get the below error.
01-20-2013 01:51 PM
However this works
04-30-2019 09:30 PM
Make the 'Get-Date' item fully evaluate.
Try:
Get-BEJobHistory -JobStatus "Error" -FromStartTime "$((Get-Date).AddHours(-12))" | ft -auto