Low disk space alert DU like Powershell script

$location = Get-Location
Get-ChildItem $location | Where-Object { $_.PSIScontainer } |
    Select @{Name="Size (MB)";Expression={(Get-ChildItem $_.Fullname -Recurse | 
    Measure-Object -Property Length -Sum).Sum/1MB}},Fullname | Sort-Object "Size (MB)" -Descending | 
    Select-Object @{Name="Size (MB)";Expression={"{0:0,0.00}" -f ($_."Size (MB)")}},Fullname | 
    Format-Table -AutoSize
Advertisements

2 thoughts on “Low disk space alert DU like Powershell script

    1. I work at Rackspace we monitor customer servers for low disk space. It’s always been a challenge to find the largest consuming folders. So we respond to SCOM Alerts for low disk space, that’s what I meant by alert.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s