mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-27 09:08:58 +01:00
Improve list-formatted.ps1
This commit is contained in:
parent
50cabecd57
commit
c9d8fb3947
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX list-formatted.ps1 [<directory>]
|
.SYNTAX list-formatted.ps1 [<directory>]
|
||||||
.DESCRIPTION lists the current working directory formatted in columns
|
.DESCRIPTION lists the current working directory formatted in columns
|
||||||
@ -13,9 +13,9 @@ function ListDir { param([string]$Path)
|
|||||||
foreach ($Item in $Items) {
|
foreach ($Item in $Items) {
|
||||||
if ($Item.Name[0] -eq '.') { continue } # hidden file/dir
|
if ($Item.Name[0] -eq '.') { continue } # hidden file/dir
|
||||||
if ($Item.Mode -like "d*") {
|
if ($Item.Mode -like "d*") {
|
||||||
New-Object PSObject -Property @{ Name = "$($Item.Name)/" }
|
new-object PSObject -Property @{ Name = "📂$($Item.Name)" }
|
||||||
} else {
|
} else {
|
||||||
New-Object PSObject -Property @{ Name = "$($Item.Name)" }
|
new-object PSObject -Property @{ Name = "📄$($Item.Name)" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user