I need to monitor a specific directory for the largest file of a few types (*.dbf, *.fpt, *.cdx) and return size and name to PRTG.
I have a PS script working to determine the file, but I'm not clear on how to return just the name and size to PRTG:
PS C:\Windows\system32> Get-ChildItem d:\apps\int\data\* -include ('*.dbf', '*.fpt','*.cdx') | Sort Length -desc | Select-Object -first 1
So - how do I grab name and size and return them to PRTG? Seems I need to write-host a JSON return string but I'm not sure how to get the size and name from what I have so far...
Add comment