Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell - Folder Watchdog

$
0
0

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.


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>