mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 22:36:12 +01:00
Updated list-empty-dirs.ps1
This commit is contained in:
parent
10e90ab3db
commit
4ea5d262bf
@ -28,7 +28,7 @@ list-automatic-variables.ps1, lists the automatic variables of PowerShell
|
||||
list-current-timezone.ps1, lists the current time zone details
|
||||
list-clipboard.ps1, lists the contents of the clipboard
|
||||
list-environment-variables.ps1, lists all environment variables
|
||||
list-empty-dirs.ps1, lists empty subfolders in a directory tree
|
||||
list-empty-dirs.ps1, lists empty subfolders within the given directory tree
|
||||
list-files.ps1, lists all files in the given folder and also in every subfolder
|
||||
list-formatted.ps1, lists the current working directory formatted in columns
|
||||
list-fritzbox-calls.ps1, lists the FRITZ!Box calls
|
||||
|
|
@ -34,7 +34,7 @@ Table of Contents
|
||||
* [list-clipboard.ps1](Scripts/list-clipboard.ps1) - lists the contents of the clipboard
|
||||
* [list-current-timezone.ps1](Scripts/list-current-timezone.ps1) - lists the current time zone details
|
||||
* [list-environment-variables.ps1](Scripts/list-environment-variables.ps1) - lists all environment variables
|
||||
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders in a directory tree
|
||||
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders within the given directory tree
|
||||
* [list-installed-software.ps1](Scripts/list-installed-software.ps1) - lists the installed software
|
||||
* [list-files.ps1](Scripts/list-files.ps1) - lists all files in the given folder and also in every subfolder
|
||||
* [list-formatted.ps1](Scripts/list-formatted.ps1) - lists the current working directory formatted in columns
|
||||
|
@ -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."
|
||||
|
Loading…
Reference in New Issue
Block a user