I’m trying to get all *.log
files within mount point sub directories.
Command: [IO.Directory]::GetDirectories('e:\')
is showing me all directories; how do I search theses subdirectories for *.log
files?
I’m trying to get all *.log
files within mount point sub directories.
Command: [IO.Directory]::GetDirectories('e:\')
is showing me all directories; how do I search theses subdirectories for *.log
files?
get-childItem e:\ -recurse -Filter *.log
for your example I think you can do :
$alldirs=ls E: -recurse -directory
$alldirs|%{
$nb=(ls -filter *.log).count
if ($nb -gt $WARNING){
"This Folder $_ is having > $nb < *.log files "
}
}