{% execute type:'class' %}
using Rock;
using Rock.Data;
using Rock.Model;
using System.IO;
using System.Text;
public class MyScript
{
public string Execute()
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
var sb = new StringBuilder();
foreach ( DriveInfo d in allDrives )
{
sb.Append( "Drive " + d.Name );
if ( d.IsReady == true )
{
var used = d.TotalSize - d.TotalFreeSpace;
var rem = ( decimal ) used / ( decimal ) d.TotalSize;
sb.Append( " Percent Full " + (rem * 100m ).ToString("0.00"));
sb.Append( "<br>" );
}
}
return sb.ToString();
}
}
{% endexecute %}