Skip to content

World Wide Web Helpers

Helping with Stuff on the World Wide Web

Category: PowerShell

How to list empty Directories via powershell

(gci C:\Scripts -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName

(replace C:\Scripts with the root directory)
Output example:
FullName
-------
C:\Scripts\Empty
C:\Scripts\Empty Folder 2
C:\Scripts\Empty\Empty Subfolder
C:\Scripts\New Folder\Empty Subfolder Three Levels Deep

Author adminPosted on May 24, 2018Leave a comment on How to list empty Directories via powershell

Categories

  • PowerShell (1)

Search

About This Site

This may be a good place to introduce yourself and your site or include some credits.

World Wide Web Helpers Proudly powered by WordPress