Powershell MP - Unit Monitor - Number of samples

Hey all

I am in the process of making a powershell unit monitor, and stumbled upon, the lack of support for multiple samples before alerting.

Can anyone point me in the right direction?

I am counting files in a folder, if it exceedes 100 for more than 2 minutes it should alert.
It has to be over a certain period of time, otherwise I could just have the script run every 2 minutes.

We use the Savision MP for file monitoring, it covers off what you’re trying to do

Sorry, but using another MP for this was not an option.

I did how ever make a workaround for this, until something better comes up.

I made an if/else statement inside my first if/else statement, so that if the value exceeded the number of files, it would sleep for 120 seconds, and run the same script again in an if/else and return the propertybags to SCOM…

Not clean, but it works!

//RSG