1

How do I use the DIR command to list all directories, including subdirectories, that contain no files? I've researched this at length and can only find how to DELETE the specified directories, but not actually list them. Can anyone help? Is there a better way other than the DIR command?

4

1 Answer 1

0

You could modify the Powerscript answer on the linked question to display instead of delete like this:

Get-ChildItem -Recurse . | where { $_.PSISContainer -and @( $_ | Get-ChildItem ).Count -eq 0 } | Select-Object -Property FullName

Not the answer you're looking for? Browse other questions tagged or ask your own question.