email

Wednesday, December 9, 2009

List the files greater than given size using powershell

Below powershell code helps you to list the files which are greater than given size(2GB in this case) and output the file sizes in MB/GB format.

PS C:\local> Get-ChildItem -path c:\mydata\ -recursive | where  { ($_.Length /1GB) -gt 2 } | foreach { ($_.length/1GB).Tostring("0.00") }

Do write in comments section here if you need any charification.

Happy Learning,
Sitaram Pamarthi

No comments:

Post a Comment