This was a major PITA to track down and create. Thanks to my powershell guy, Jeff and the Power Shell manual provided by SolarWinds, we finally got it!
$files = Get-ChildItem \\${IP}\d$;
write-host "statistic: " $files.count;
write-host "message: " $files;
exit(0);
Line-by-line:
store the command get-childitem <string> in the $files variable. The ${IP} variable is a SolarWinds universal variable which pulls the node you are testing this against.
write the number of files to a statistic (and display it in script output)
write the results of the $files variable (which is just a fancy way of doing a 'dir' command in the current d$ drive)
exit with a 0 (up) if successful
Important Note! Make sure to place a checkmark in 'Impersonate with component's credentials.' This is what kept us from figuring this out!!!
Hope this helps someone!
Mike Sh