Wednesday, 22 January 2014

Disk Usage Information

Program to get Disk usage information 

Use the below script to find the disk usage on windows. This script would be helpful when you want to work on disk utilization tasks such as cleanup process on  disks, Auditing purpose etc,.

Use this script to check the limit of disk utilization. And use Send-Mailmessage to send the alert to the specific person and schedule the script on task scheduler.

function get-DiskUsage {

Get-ChildItem -Recurse -Directory | Select-Object FullName,
@{ Name="Size";
Expression={ ($_ | Get-ChildItem |
Measure-Object -Sum Length).Sum + 0 } }
}