List Folder Sizes

# Powershell Script to list folders sizes
Install-Module PSFolderSize
$folders = "\\FILESERVER01\SHARE01","C:\Windows\Users\kimconnect"

foreach ($folder in $folders){
	$folder +": "+ ("{0:N2} GB" -f ((Get-ChildItem $folder -Recurse | Measure-Object -Property Length -Sum -ErrorAction SilentlyContinue).Sum / 1GB))+ "- on "+(Get-Date -Format g);
}

Leave a Reply

Your email address will not be published. Required fields are marked *