Monday, June 1, 2015

#77 : How to get directory size using Powershell?

A quick tip, to get the size of the folder, you can use below line :

"{0:N2}" -f ($(ls "c:\temp" -recurse | Measure-Object -property length -sum).sum /1MB)  + " MB"


Replace MB with KB if you want in KB.


"{0:N2}" -f ($(ls "c:\temp" -recurse | Measure-Object -property length -sum).sum /1MB)  + " MB"
 
Hope this was easy, right?
 

1 comment:

  1. Borgata Hotel Casino & Spa - Mapyro
    The Borgata 충청북도 출장안마 Hotel Casino & Spa 하남 출장마사지 is a hotel and 포항 출장안마 casino located in Atlantic City, New 동두천 출장샵 Jersey. The 광주 출장샵 hotel has 1,078 rooms and suites, approximately 192,000 square feet

    ReplyDelete

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...