Looking for some guidance for the best method to watch a specific folder and return a pass fail when checking at if there is a file with the today() date stamp. Does anybody have such a script in their library.
I have the following code snippet that will display the file if the condition is true.
Powershell
$date=Get-Date$date=$date.AddHours(-($date.Hour))$date=$date.AddMinutes(-($date.Minute))get-childitem-Pathc:\pstest-recurse|Where-Object{$_.lastwritetime-gt$date}
Ultimately I am looking to have an e-mail sent with the status of PASS or FAIL if the condition is met.