1

下面的代码计算目录和子目录中某些类型的文件的数量:

$filetype = @("*.jpg", "*.jpeg","*.png","*.gif", "*.bmp")
$file_count = Get-ChildItem -Path $filepath -Include $filetype -Recurse -File | Measure-Object | %{$_.Count}
$output = "images: `t" + $file_count
Write-Output $output;

我将如何计算不属于这些类型的所有文件的数量?

4

1 回答 1

1

只需替换-Include $filetype-Exclude $filetype

于 2016-06-15T15:44:17.853 回答