Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path name size

Status
Not open for further replies.

toolbox212121

Technical User
Nov 18, 2010
73
US
I am trying to write a script to scan all path names for every file in the drive and find ones that are larger than 512 and output the results to a text file. I'm new to powershell and lost. All I have now is printing all paths from a drive and outputting this to a text file then cut and past into excel and use LEN(a1,b1,c1.....) and do a sort. I would like to just have the script only display the ones over 512. Any advice? Thanks
 
I'm sure there's a better way to do it, but see where this leads you
Code:
gci *.txt | foreach {$n = $_.FullName; if ($n.Length -gt 20) {write-host "$n  $($n.Length)"}}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top