Updated the scripts

This commit is contained in:
Markus Fleschutz
2020-10-10 16:51:57 +00:00
parent e12f1961b4
commit c3c17e48d7
30 changed files with 41 additions and 43 deletions

View File

@ -1,5 +1,5 @@
#!/snap/bin/powershell
#
# Syntax: ./list-empty-dirs.ps1 <dirtree>
# Description: lists empty subfolders in the <directory tree>
# Author: Markus Fleschutz
@ -11,7 +11,7 @@ param([string]$DirTree)
write-host "Listing empty subfolders in $DirTree ..."
try {
(gci $DirTree -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName
(Get-ChildItem $DirTree -recurse | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName
echo "Done."
exit 0
} catch { Write-Error $Error[0] }