Collections:
Other Resources:
Get Directory Properties in Windows PowerShell
How to get directory properties in Windows PowerShell? I want to know how many files are there in a directory.
✍: FYIcenter.com
If you want to get measurement properties of a directory in Windows PowerShell
like total file size,
you can use the "Get-ChildItem ... -Recurse | Measure-Object -Sum Length" pipeline.
Here is good example of getting directory storage size and file count in Windows PowerShell:
PS C:\fyicenter> Get-ChildItem C:\Windows\System32 | Measure-Object -Sum Length Count : 3159 Average : Sum : 1451982183 Maximum : Minimum : Property : Length PS C:\fyicenter> Get-ChildItem C:\Windows\System32 -Recurse | Measure-Object -Sum Length ... You may see some permission errors Count : 19133 Average : Sum : 4005893965 Maximum : Minimum : Property : Length
Note that the second command includes all subdirectories recursively, which gives the true total storage size of 4,005,893,965 bytes (about 4GB), and 19,133 files.
Also note that you need to run the PowerShell as an administrator to have better permission to reach directories and files that require higher level of permissions.
⇒ Get File Content in Windows PowerShell
⇐ Get File Properties in Windows PowerShell
2016-10-22, ∼3525🔥, 0💬
Popular Posts:
What are Exploit-ObscuredHtml Trojan Web Pages? If you have McAfee VirusScan installed, sometimes yo...
What is the scheduled task "\Microsoft\Windows\NetC fg\BindingWorkItemQueueH andler"on my Windows 8 c...
product key for adding features to windows 8 The product key you require is MBFBV-W3DP2-2MVKN-PJCQD- ...
How to select your wireless connection during the Windows 7 system initial set up process? If you bo...
How to use IMDisplay to display an image file? If have image file called wizard.jpg and want to use ...