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: Excute Function Remotely

$computername=$env:computerName $adminUsername='doeMainAdmin' $adminPassword='frackingPassword' $adminCredential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $adminUsername,$(ConvertTo-securestring $adminPassword -AsPlainText -Force) function execFunctionRemotely{ param( [Parameter(Mandatory=$true)][string]$computerName,…

Optimizing Windows IIS Server

Most IIS instances are fine with default settings. However, it's often beneficial to configure some…

Script to Push Files to Remote SFTP Server

# 1. Install WINSCP and include it in the %PATH% environmental variables# 2. Run this…
Other project: DragonCoin.com