mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-18 20:08:45 +01:00
Update check-symlinks.ps1
This commit is contained in:
parent
b7f0bca5bb
commit
3d776af3cc
@ -32,7 +32,7 @@ try {
|
|||||||
$item = Get-Item $path -ErrorAction Ignore
|
$item = Get-Item $path -ErrorAction Ignore
|
||||||
if (!$item) {
|
if (!$item) {
|
||||||
$NumBroken++
|
$NumBroken++
|
||||||
"Broken symlink #$($NumBroken): $Symlink ⭢ $Target"
|
"📂$Symlink ⭢ $Target (broken symlink #$($NumBroken))"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$NumTotal++
|
$NumTotal++
|
||||||
@ -40,13 +40,11 @@ try {
|
|||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
if ($NumTotal -eq 0) {
|
if ($NumTotal -eq 0) {
|
||||||
"✔️ found no symlink at 📂$FullPath in $Elapsed sec"
|
"✔️ found no symlink at 📂$FullPath in $Elapsed sec."
|
||||||
} elseif ($NumBroken -eq 0) {
|
|
||||||
"✔️ found $NumTotal valid symlinks at 📂$FullPath in $Elapsed sec"
|
|
||||||
} elseif ($NumBroken -eq 1) {
|
} elseif ($NumBroken -eq 1) {
|
||||||
"✔️ found $NumBroken broken symlink out of $NumTotal at 📂$FullPath in $Elapsed sec"
|
"✔️ found $NumBroken broken symlink at 📂$FullPath in $Elapsed sec."
|
||||||
} else {
|
} else {
|
||||||
"✔️ found $NumBroken broken symlinks out of $NumTotal at 📂$FullPath in $Elapsed sec"
|
"✔️ found $NumBroken broken symlinks at 📂$FullPath in $Elapsed sec."
|
||||||
}
|
}
|
||||||
exit $NumBroken
|
exit $NumBroken
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user