Update list-dir-tree.ps1 and list-folder.ps1

This commit is contained in:
Markus Fleschutz 2023-04-26 16:53:53 +02:00
parent 6abf457fb3
commit f3ba42d867
2 changed files with 21 additions and 19 deletions

View File

@ -17,14 +17,16 @@ param([string]$DirTree = "$PWD")
function GetFileIcon { param([string]$Suffix)
switch ($Suffix) {
".csv" { return "📊" }
".epub" { return "📓" }
".gif" { return "🎨" }
".iso" { return "📀" }
".jpg" { return "🎨" }
".mp3" { return "🎵" }
".mkv" { return "🎬" }
default { return "📄" }
".conf" {return "⚙️"}
".csv" {return "📊"}
".epub" {return "📓"}
".gif" {return "📸"}
".iso" {return "📀"}
".jpg" {return "📸"}
".mp3" {return "🎵"}
".mkv" {return "🎬"}
".zip" {return "📦"}
default {return "📄"}
}
}
@ -53,7 +55,7 @@ try {
[int]$global:Files = 0
[int]$global:Bytes = 0
ListDir $DirTree 0
"(Total: $($global:Dirs) folders, $($global:Files) files, $($global:Bytes) bytes)"
" ($($global:Dirs) folders, $($global:Files) files, $($global:Bytes) bytes in total)"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -17,16 +17,16 @@ param([string]$searchPattern = "*")
function GetFileIcon { param([string]$suffix)
switch ($suffix) {
".csv" { return "📊" }
".epub" { return "📓" }
".gif" { return "🎨" }
".iso" { return "📀" }
".jpg" { return "🎨" }
".mp3" { return "🎵" }
".mp4" { return "🎬" }
".mkv" { return "🎬" }
".ps1" { return "📑" }
default { return "📄" }
".conf" {return "⚙️"}
".csv" {return "📊"}
".epub" {return "📓"}
".gif" {return "📸"}
".iso" {return "📀"}
".jpg" {return "📸"}
".mp3" {return "🎵"}
".mkv" {return "🎬"}
".zip" {return "📦"}
default {return "📄"}
}
}