Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试获取*.log挂载点子目录中的所有文件。
*.log
Command: [IO.Directory]::GetDirectories('e:\')
正在向我显示所有目录;如何在这些子目录中搜索*.log文件?
get-childItem e:\ -recurse -Filter *.log
对于您的示例,我认为您可以这样做:
$alldirs=ls E: -recurse -directory $alldirs|%{ $nb=(ls -filter *.log).count if ($nb -gt $WARNING){ "This Folder $_ is having > $nb < *.log files " } }