I've created a a FileSystemWatcher
object that I have events registered for. I intend that this script will run an execute mocha
in the same directory. I can execute mocha
from the script using:
$testProgram = "mocha"
& $testProgam
I get the results.. ...
3 test complete....
Now when I take this same code and wrap it in the event like this...
$changed = Register-ObjectEvent $watcher "Changed" -Action {
clear
write-host "Running Test Scripts.........."
write-host "Changed: $($eventArgs.FullPath)"
& testProgram
}
I get this...
Running Test Scripts.......................
Changed: C:\files\main.js
Where are the results of the & testProgram
?