Note:
Run this script as Cusotm monitoring.
Refer the below link to know how to run custom monitoring.
https://wiki.itarian.com/frontend/web/topic/how-to-use-custom-script-procedure-monitoring
This script will monitor the file count of a specified directory on a windows machine. If file count is less than minimum count or greater than maximum count, the script will raise an alert and will create a service desk ticket.