Created
March 22, 2012 15:18
-
-
Save aldente39/2158969 to your computer and use it in GitHub Desktop.
ls with color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#rm alias:ls -force | |
#set-alias ls myls | |
filter lsColor{ | |
if($_.mode[0] -eq "d"){ | |
Write-Host $_.name -ForeGroundColor Green | |
} | |
elseif($_.get_Extension() -eq ".exe"){ | |
Write-Host $_.name -ForeGroundColor Yellow | |
} | |
else{ | |
Write-Host $_.name | |
} | |
} | |
function myls{ | |
$c = "Get-ChildItem " + $args | |
Invoke-Expression $c | lsColor | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment