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

Linux: GREP Training

Lorum Ipsum - let's learn about grep, ya'll Examples: # Get information only on the…

PowerShell: Improve Network Speed of Windows on 20 Mbps or Faster Connections

This has been tested on Windows 10 - will not work on a Server OS:…

Puppet Client Server Lab Setup

Server # Setup client machine name sudo vim /etc/hosts ## Insert this line ## xx.xx.xx.xx…