Hi,
It seems we can use the following PS script to achieve our goal.
$api = New-Object -comObject "MOM.ScriptAPI"
$PropertyBag = $api.CreatePropertyBag()
$file_count = (get-item c:\temp\result*.csv).count
$PropertyBag.AddValue("FileCount",$file_count)
$PropertyBag
create a unit monitor based on powershell script
MP download link:
https://gallery.technet.microsoft.com/Sample-Management-Pack-17b76379
name the monitor, add target and enter the powershell script
after that, add the criteria
The criteria we can use:
Property[@DeezNutz ="FileCount"]
Hope the above information helps.
Alex Zhu
If the response is helpful, please click "Accept Answer" and upvote it.