- Help Center
- Data Governance
- Exception Management
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.
- Create a new Compare Query in exMon Data Governance by right-clicking the Tests folder
- In the first query window, choose the PowerShell Data Provider and add the following PowerShell script:
-
$path = "C:\temp\Names*.txt"
$exMonResult = Get-ChildItem $path | Select-Object -Property FullName,CreationTime | exMon-Out-DataTable - In the second query window, choose the Saved Comparative Data Provider and set it to autosave results during each execution.
- Map the output columns as normal.
- Make sure only DS2 incl. DS1 is selected. That makes sure we are only notified of new files, not removed files.
- Configure email settings and schedule as normal.
Example email from the test:
Gunnar is the author of this solution article.