mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-10 05:17:44 +02:00
Updated the scripts
This commit is contained in:
@ -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] }
|
||||
|
Reference in New Issue
Block a user