forked from D3REKZHANG/Pretty-ls
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrettyLs.psm1
More file actions
45 lines (41 loc) · 962 Bytes
/
Copy pathPrettyLs.psm1
File metadata and controls
45 lines (41 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function ls {
param()
$directories = Get-ChildItem -path . -directory -name -Force
foreach ($item in $directories){
Write-Host $([char]0xe5ff) -ForegroundColor Blue -NoNewline
Write-Host " $item"
}
$files = Get-ChildItem -path . -file -name -Force
foreach ($item in $files){
$split = $item.Split('.')
$ext = $split[$split.Count - 1]
if ($symbols.ContainsKey($ext)){
Write-Output "$([char]$symbols[$ext]) $item"
} else {
Write-Output "$([char]0xf713) $item"
}
}
}
$symbols = @{
c = 0xe61e
cpp = 0xe61d
css = 0xe74a
java = 0xe738
js = 0xf81d
ts = 0xfbe4
jsx = 0xe7ba
tsx = 0xe7ba
json = 0xe60b
pdf = 0xf724
py = 0xe73c
psm1 = 0xe796
rb = 0xe739
rs = 0xe7a8
scala = 0xe737
vim = 0xe61e
md = 0xf718
txt = 0xf718
log = 0xf718
docx = 0xf718
}
Export-ModuleMember -Function ls