I add it to the Script body and run a test but it fails with a -1. If I run it outside of Solarwinds it takes a while but comes back with the correct number of files.
#>
Try
{
$recordings = get-childitem -path "\\bangtest2\d$\recordings" -recurse -ErrorAction Stop | ?{$_.creationtime -gt (get-date).adddays(-1)} | measure
$recordings.count
}
Catch
{
[system.exception]
return -1
}
Finally
{
}