This script will count the numbers of files in a folder and output to file.
$dirs = “dir.txt”
foreach ($dir in [System.IO.File]::ReadLines($dirs)) {
“$dir, $((Get-ChildItem $dir -filter “*.msg” -ea 0).Count)”
}
Lab Core | The Lab of MrNetTek
A blog about IT, technical solutions, and code.