Powershell get number of files and folders in directory -
Powershell get number of files and folders in directory -
i going write powershell script gets various statistics on dir in.
if
get-childitem
i this
d---- 06/23/2014 2:49 pm asdf; -a--- 06/23/2014 2:49 pm 23 new text document - re-create (2).txt -a--- 06/23/2014 2:49 pm 23 new text document - re-create (3).txt -a--- 06/23/2014 2:49 pm 23 new text document - re-create (4).txt -a--- 06/23/2014 2:49 pm 23 new text document - re-create (5).txt -a--- 06/23/2014 2:49 pm 23 new text document - copy.txt -a--- 06/23/2014 2:49 pm 23 new text document.txt
and if
(get-childitem).count
i
7
i want able count number of files in directory number of folders. suggestions appreciated. thanks.
well, want 2 different things, you're going need run 2 different commands. count folders:
(gci|?{$_.psiscontainer}).count
and count files:
(gci|?{!$_.psiscontainer}).count
batch-file powershell scripting cmd
Comments
Post a Comment