mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-10 05:17:44 +02:00
Updated list-empty-dirs.ps1
This commit is contained in:
@ -1,14 +1,17 @@
|
||||
#!/bin/powershell
|
||||
<#
|
||||
.SYNTAX ./list-empty-dirs.ps1 <dirtree>
|
||||
.DESCRIPTION lists empty subfolders in the <directory tree>
|
||||
.SYNTAX ./list-empty-dirs.ps1 [<dir-tree>]
|
||||
.DESCRIPTION lists empty subfolders within the given directory tree
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
param([string]$DirTree)
|
||||
param($DirTree = "")
|
||||
|
||||
try {
|
||||
if ($DirTree -eq "" ) {
|
||||
$DirTree = read-host "Enter the path to the directory tree"
|
||||
}
|
||||
write-progress "Listing empty subfolders in $DirTree ..."
|
||||
(Get-ChildItem $DirTree -recurse | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName
|
||||
echo "Done."
|
||||
|
Reference in New Issue
Block a user