Syntax
##Script to display size of folders
$folder = ‘D:\P-Test’
$size = 0
$decimalPlaces = 2
$output = @()
Get-ChildItem -Directory $folder | ForEach-Object {
$size += (Get-ChildItem -Recurse $_.FullName | Measure-Object -Property Length -Sum).Sum
$output += New-Object PSObject -Property @{
Download Full Script
| Purpose: | Display Folder Sizes Under a Specific Drive or Directory |
| Modification: | |
| Type: | PowerShell Script |
| Compatibility: | Windows PowerShell, Compatible with NTFS File System |
| Tags: | Folder Size, Storage Analysis, NTFS |
| Reference link: |