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: Check TCP Connections of Server by Port Numbers

# Check-TCP-Connections.ps1# This function will output progress onto the console as well as returning a…

PowerShell: Windows Session Memory Usage Watcher

# windowsSessionWatcher.ps1 $serverNames=@( 'IRV-RDS01.domain1.net', 'LAX-RDS02.domain2.com ) $thresholdMemoryUsagePercent=30 $thresholdMemoryGb=20 $domainCreds=@( @{domain='domain1.ad';username='domain1\sysadmin';password=$env:pass1} @{domain='domain2.com';username='domain2\sysadmin';password=$env:pass2} ) # Email relay…

Basic JavaScript: Comparison with the Strict Inequality Operator

function testStrictNotEqual(val) {// Only Change Code Below this Line// Add the strict inequality operator to…