Hey Admine,
For LM Powershell script interractions i strongly suggest using the Logicmonitor PS module - it has many benefits: https://logicmonitor.github.io/lm-powershell-module-docs/getting-started/
For filtering data, i find it easier to pull everything from LM into a PS variable/table/hash/array/etc. and then filter afterwards.
you could use something like this an an example:
$filteredRootPaths = $RootPath | ForEach-Object {
$_ | Where-Object { $_.name -like "<custom threshold>" }
}
$filteredRootPaths.Count
Hope i helped. Good luck.