Update list-dir-tree.ps1

This commit is contained in:
Markus Fleschutz 2023-10-06 12:29:05 +02:00
parent e2aaef5499
commit 3ce90ab07c

View File

@ -9,7 +9,7 @@
PS> ./list-dir-tree.ps1 C:\MyFolder PS> ./list-dir-tree.ps1 C:\MyFolder
📂Results 📂Results
📄sales.txt (442K) 📄sales.txt (442K)
(2 folders, 1 file, 442K total) (2 folders, 1 file, 442K file size in total)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -69,7 +69,7 @@ try {
[int64]$global:files = 0 [int64]$global:files = 0
[int64]$global:bytes = 0 [int64]$global:bytes = 0
ListDirectory $Path 0 ListDirectory $Path 0
Write-Output " ($($global:folders) folders, $($global:files) files, $(Bytes2String $global:bytes) total)" Write-Output " ($($global:folders) folders, $($global:files) files, $(Bytes2String $global:bytes) file size in total)"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"