Posted On March 29, 2019

List Folder Sizes

kimconnect 0 comments
blog.KimConnect.com >> Codes >> 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 *

Related Post

PowerShell: Stop Any Service on Windows!

Problem: some system protected services cannot be stopped. PS C:\Users\KingKong> stop-service msmpsvcStop-Service : Service 'Microsoft…

Bash Shell: Rename Files – Prepend and Append

Pre-pending # Prepend any file that doesn't have the word "/thumbs_" in its full path…

PowerShell: Search for Failed Logins on Primary Domain Controller

# Quick Script to search for failed logins$daysLimit=7$userName="Bruce"$todaysDate= Get-date$pdc = (Get-ADDomain).PDCEmulator #$allDCs = ((Get-ADForest).Domains |…