Hi @Saravanaraj-6475 ,
I would put the last condition in brackets, like that:
If ($SendAlert -and (((get-date).TimeOfDay.Hours -lt 1) -and ((get-date).timeofday.Hours -gt 3))-and ($ErrorResult.ErrorDetails -notlike "E:\Program Files (x86)\data"))
hope this helps.
(If the reply was helpful please don't forget to upvote or accept as answer, thank you)
Best Regards!
Stoyan