File counting with Powershell commands

前端 未结 2 788
囚心锁ツ
囚心锁ツ 2021-02-13 18:31

How can I count all files in a specific folder (and all subfolders) with the Powershell command Get-ChildItem? With (Get-ChildItem -recurse

2条回答
  •  旧时难觅i
    2021-02-13 18:53

    Filter for files before counting:

    (Get-ChildItem  -recurse | where-object {-not ($_.PSIsContainer)}).Count
    

提交回复
热议问题