Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Folder Size

$
0
0

Good morning, I am trying to get the folder size for a root folder. I have a script I use (see attached) with a csv path to the root folder (example \\server\shared\root folder1, \\server\shared\root folder1 )

Problem - Running my script in powershell shows this error but continues and gives the size

Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters and the directory name must be less than 248 characters at File path.

I am worried I wont get the exact size since it didnt pick those files. Any one with better script or how to go around this please.

Powershell
$folders=Import-CSV"D:\Users\xxxxxxx\Desktop\size.csv"foreach($folderin$folders){$colItems=(Get-ChildItem$folder.Folders-recurse|Measure-Object-propertylength-sum)"{0:N2}"-f($colItems....

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>