I don’t know if one exists, but it wouldn’t take much to build it. You’d need a Powershell based DS that implements this method: https://www.partitionwizard.com/partitionmanager/powershell-get-folder-size.html. Consider creating a multi-instance DS with discovery based on a property value. You could create a property called folders_monitored_for_size. The value could be like this:
ID1;Folder1DisplayName;C:\my folder|ID2;Folder2Name;D:\data
Then your discovery script (which could be groovy even if collection is PS based) would look like this:
hostProps.get("folders_monitored_for_size").tokenize("|").each{folder ->
x = folder.tokenize(';')
println("${x[0]}##${x[1]}##${x[2]}")
}
return 0
To construct the value of the folders_monitored_for_size, start with the list of folders to monitor on a device:
Then come up with a unique id and a display name for each (ID cannot have =, :, \, #, or space, but otherwise can be anything you want unique on that device):
- Personal Directory - 1
- Data Directory - 2
Then your property would look like this:
1;Personal Directory;C:\my folder|2;Data Directory;D:\data
You’d end up with two instances, each of them would be monitored by the collection, which I’ll explain next.
I’d make this a script not batchscript DS simply because it’ll make the script easier. You’ll need your script to pull the instance wildvalue and description into your PS script by doing $wildvalue= '##system.wildvalue##', similar for instance description.
Then you’d just execute the method linked above and output the size. If i have more time later, I may flesh this out more, but you should at least be able to get started with what’s here.