Finding truly empty folders with Powershell
The easiest approach to find empty folders with Powershell could be:
(gci C:\Scripts -r | ? {$_.PSIsContainer -eq $True}) | ? {$_.GetFiles().Count -eq 0} | select FullName
however this just finds the folders which have no files in them. To find truly empty folders – the one which also have no subfolders – use the following:
(gci C:\Scripts -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName