mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-25 11:28:17 +02:00
Update list-dir-tree.ps1 and list-folder.ps1
This commit is contained in:
parent
6abf457fb3
commit
f3ba42d867
@ -17,14 +17,16 @@ param([string]$DirTree = "$PWD")
|
|||||||
|
|
||||||
function GetFileIcon { param([string]$Suffix)
|
function GetFileIcon { param([string]$Suffix)
|
||||||
switch ($Suffix) {
|
switch ($Suffix) {
|
||||||
".csv" { return "📊" }
|
".conf" {return "⚙️"}
|
||||||
".epub" { return "📓" }
|
".csv" {return "📊"}
|
||||||
".gif" { return "🎨" }
|
".epub" {return "📓"}
|
||||||
".iso" { return "📀" }
|
".gif" {return "📸"}
|
||||||
".jpg" { return "🎨" }
|
".iso" {return "📀"}
|
||||||
".mp3" { return "🎵" }
|
".jpg" {return "📸"}
|
||||||
".mkv" { return "🎬" }
|
".mp3" {return "🎵"}
|
||||||
default { return "📄" }
|
".mkv" {return "🎬"}
|
||||||
|
".zip" {return "📦"}
|
||||||
|
default {return "📄"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +55,7 @@ try {
|
|||||||
[int]$global:Files = 0
|
[int]$global:Files = 0
|
||||||
[int]$global:Bytes = 0
|
[int]$global:Bytes = 0
|
||||||
ListDir $DirTree 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
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -17,16 +17,16 @@ param([string]$searchPattern = "*")
|
|||||||
|
|
||||||
function GetFileIcon { param([string]$suffix)
|
function GetFileIcon { param([string]$suffix)
|
||||||
switch ($suffix) {
|
switch ($suffix) {
|
||||||
".csv" { return "📊" }
|
".conf" {return "⚙️"}
|
||||||
".epub" { return "📓" }
|
".csv" {return "📊"}
|
||||||
".gif" { return "🎨" }
|
".epub" {return "📓"}
|
||||||
".iso" { return "📀" }
|
".gif" {return "📸"}
|
||||||
".jpg" { return "🎨" }
|
".iso" {return "📀"}
|
||||||
".mp3" { return "🎵" }
|
".jpg" {return "📸"}
|
||||||
".mp4" { return "🎬" }
|
".mp3" {return "🎵"}
|
||||||
".mkv" { return "🎬" }
|
".mkv" {return "🎬"}
|
||||||
".ps1" { return "📑" }
|
".zip" {return "📦"}
|
||||||
default { return "📄" }
|
default {return "📄"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user