I'm running a command to list directories, subdirectories, and a file count. It works fine in powershell but I want it to output to a .txt file. So far all it outputs is a blank file.
dir -recurse |
?{ $_.PSIsContainer } |
%{ Write-Host $_.FullName (dir $_.FullName |
Measure-Object).Count }>list.txt