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

JavaScript: Pomodoro Clock

Demo: Pomodoro Clock HTML Code: <body> <div class="header"> <h1>Pomodoro Timer</h1> <h2>A Free Code Camp Student…

Microsoft SQL AlwaysOn High Availability Cluster Management Tool

There are some bugs in the script. I'm too lazy to go back a fix…

PowerShell: Convert String to Command

# Method 1 $command =@"ping google.com"@$scriptBlock = [Scriptblock]::Create($command)Invoke-Command -ComputerName localhost -ScriptBlock $scriptBlock# Method 2$xVariable="K1"$yVariable="ping"$commandString=$yVariable+" "+$xVariablefunction…