Added list-empty-files.ps1

This commit is contained in:
Markus Fleschutz
2021-02-10 18:37:55 +01:00
parent cf7b28a93f
commit 61b0c3e65d
4 changed files with 26 additions and 1 deletions

View File

@ -13,8 +13,9 @@ try {
$DirTree = read-host "Enter the path to the directory tree"
}
write-progress "Checking symlinks in $DirTree..."
[int]$SymlinksTotal = [int]$SymlinksBroken = 0
gci $DirTree -Recurse | Where { $_.Attributes -match "ReparsePoint" } | ForEach-Object {
Get-ChildItem $DirTree -recurse | Where { $_.Attributes -match "ReparsePoint" } | ForEach-Object {
$Symlink = $_.FullName
$Target = ($_ | Select-Object -ExpandProperty Target -ErrorAction Ignore)
if ($Target) {