mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-14 09:58:59 +01:00
Merge branch 'master' of github.com:fleschutz/PowerShell
This commit is contained in:
commit
7e476ca1cb
@ -11,12 +11,14 @@ param($Directory = "$PWD")
|
||||
function ListDir { param([string]$Path)
|
||||
$Items = get-childItem -path $Path
|
||||
foreach ($Item in $Items) {
|
||||
if ($Item.Name[0] -eq '.') { continue } # hidden file/dir
|
||||
if ($Item.Mode -like "d*") {
|
||||
new-object PSObject -Property @{ Name = "📂$($Item.Name)" }
|
||||
} else {
|
||||
new-object PSObject -Property @{ Name = "📄$($Item.Name)" }
|
||||
}
|
||||
$Name = $Item.Name
|
||||
if ($Name[0] -eq '.') { continue } # hidden file/dir
|
||||
if ($Item.Mode -like "d*") { $Icon = "📂"
|
||||
} elseif ($Name -like "*.iso") { $Icon = "📀"
|
||||
} elseif ($Name -like "*.mp3") { $Icon = "🎵"
|
||||
} elseif ($Name -like "*.epub") { $Icon = "📓"
|
||||
} else { $Icon = "📄" }
|
||||
new-object PSObject -Property @{ Name = "$Icon$Name" }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user