Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – Get Folder Size

Posted on November 9, 2015 By David Kittell
function Get-FolderSize {
$location = $args[0]
Write-Host "Directory to Scan:"$location
$value = "{0:N2}" -f ((Get-ChildItem -recurse $location | Measure-Object -property length -sum).Sum / 1MB)
Write-Host "Used Storage for Directory:"$value" MB"
}

Get-FolderSize ("c:\temp")

Reference: http://poshcode.org/5647

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell

Post navigation

Previous post
Next post

Related Posts

PowerShell – Download Azure Blob Container Content

Posted on September 6, 2017

You get all of your data into Azure or your application uploads/creates directly into Azure storage and then someone asks you to download the files…. This script below will help you download your files. $StartTime = $(get-date) $datetime = $(get-date -f yyyy-MM-dd_hh.mm.ss) $connection_string = ” $AzureBlobContainerName = ” $destination_path =…

Read More

BO Pri

Posted on May 20, 2013October 26, 2015

SELECT ID , RequestNumber , cat_id , CASE WHEN bo_priority IS NULL THEN ‘99999’ WHEN bo_priority = ‘0’ THEN ‘99999’ else bo_priority END as bonpri ,bo_priority , Description , requestorID , programmerID , DeadlineDate , ProjectedDate , purpose , ((SELECT location FROM dbo.tblDefaultLocation WHERE tblDefaultLocation.locationid = tblRequestInfo.location) + ‘-‘ +…

Read More

Ektron Alias With Folder Name

Posted on February 25, 2014October 26, 2015

With assistance from my Ektron Content Folder Names script this script will display all aliases with the folder that the content belongs to. This is not an ideal process as you can have many folders in Ektron but this can help. SET NOCOUNT ON DECLARE @Domain VARCHAR(50) SET @Domain =…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes