Notify when there is a new file in a folder

Created by: Gunnar Steinn Magnússon

The PowerShell Data Provider in exMon can be used for various things. In this post, you will create a test in exMon, using PowerShell to notify you whenever there is a new file that matches a pattern in a folder.

  1. Create a new Compare Query in exMon Data Governance by right-clicking the Tests folder
  2. In the first query window, choose the PowerShell Data Provider and add the following PowerShell script:
  3. $path = "C:\temp\Names*.txt"

    $exMonResult = Get-ChildItem $path | Select-Object -Property FullName,CreationTime | exMon-Out-DataTable
  4. In the second query window, choose the Saved Comparative Data Provider and set it to autosave results during each execution.
  5. Map the output columns as normal.
  6. Make sure only DS2 incl. DS1 is selected. That makes sure we are only notified of new files, not removed files.
  7. Configure email settings and schedule as normal.

Example email from the test: 

Gunnar is the author of this solution article.