$fso = New-Object -com "Scripting.FileSystemObject"
$f = $fso.GetFolder("D:\websphere\logs")
foreach ($folder in $f.subfolders)
{
Write-Host $((get-childitem $folder.path).count)','$folder.Path
New-Object -TypeName PSObject -Property @{
SystemName = $((get-childitem $folder.path).count)
Reachable = $folder.Path
} | Export-Csv -path D:\websphere\output.txt -Append
$data = import-csv -path D:\websphere\output.txt -header close, server
$data | where-object{$_.close -gt 250} |format-table -autosize
$fso = New-Object -com "Scripting.FileSystemObject"
$f = $fso.GetFolder("C:\Windows\Media")
foreach ($folder in $f.subfolders){Write-Host $((get-childitem $folder.path).count)','$folder.Path}
You've reached the end of your complimentary solution views. To submit your own question to Ask the Experts™ or to view more solutions, start a free trial of Expert Office®.
Start 7-Day Free Trial
Premium Content
You need an Expert Office subscription to comment.Start Free Trial