Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Script to check huge folder size

$
0
0

Hello Guys,

 

Am using the below script line to check the directory folder Size.

 

$pth = "\\Share\MyFolder"

"{0:n2}" -f ((gci -path $pth -recurse | measure-object -property length -sum).sum /1gb)+" gb"

 

 

But this folder size is more than 200 GB, my script is taking very long time to show the result. 

the issue is after a wait for more than 40 minutes also i dint get output. 

 

(But the same script, poiting to folder with less size shows result immediately - confirmed to check the script works)

 

 

is there any other way i can make my script effecient to check huge folder size

 

Please assist.


Viewing all articles
Browse latest Browse all 8583

Trending Articles