

To see the action runbook jobs, click on View watcher action jobs. Click on View watcher streams under Streams to see that the watcher has found the new file and started the action runbook. SourceEventArgs : System.IO.ErrorEventArgs Navigate to your Automation account and select Watcher tasks under Process Automation. Here's what happens when the monitored folder disappears (that's how I'm forcing an error)

Here are the values you can monitor with their respective descriptions : Attributes. NET enumerator and pressing CTRL + SPACE to force the intellisense : System.IO.NotifyFilter:: CTRL + SPACE. $Event.SourceArgs | Out-Host # 2 Hash Tables Sender and SourceEventArgs You can access the possible values by calling this. I Have a file watcher.ps1 which monitors file change in sms.txt and triggers moma.ps1. Write-Host "`$Event.SourceArgs | Out-Host" I need a bit of help with powershell scripting. $Event.SourceEventArgs | Out-Host # Empty?! not like Event Write-Host "`$Event.SourceEventArgs | Out-Host" Write-Host "inside Error handler at "+ $Event.TimeGenerated Option 1: Run a powershell script by schedule task (As amit says) Option 2: Create.
POWERSHELL FILEWATCHER CODE
Here's the development / testing code from my Error event action block: Whether it is monitoring for files and folders being updated in a specific location or you want to set up a sort of Dropbox to dump files in, the options for doing any sort of monitoring against a folder (or. Using the FileSystemWatcher class will aid in documenting even the slightest changes. The example presents one specific situation - what I want to do is log any error event that is thrown. Tracking Changes to a Folder Using PowerShell. The best I've found is this C# example of using the ErrorEventArgs Class, but I'm having no success leveraging that into logging any errors that might be getting thrown when the logging stops. I've been searching for days now, and I'm not finding much information about using the Class Error event. NET FileSystemWatcher Class and all is working well - except for when it's not.
