So, download yourself the File Watcher Simple
http://sourceforge.net/projects/fwutilities/
Click New
Give the Daemon a name, and have it watch say the c:\Test
I only needed ‘File or folder created’ checked and the event is File name
Under process Tab I just type powershell
Check box the ‘Start process when file system change is detected’
And I used c:\test as the process working directory
Under Process arguments:
c:\test.ps1 %1
And Process arguments file name escape string:
%1
and check box the Use file name as argument
—
So what does our little test.ps1 powershell file look like
$FileName=$args[0]
$SearchString = “string”
$PSEmailServer = “mailserver”
$Sel = select-string -pattern $SearchString -path $FileName
If ($Sel -eq $null)
{
echo “Not Found”
}
Else
{
echo “Found”
Send-MailMessage -to “email@email.com” -from “<somehwere@somewhere.com>” -Subject “found” -body “found”
}