Skip to content

Instantly share code, notes, and snippets.

@aldente39
Created March 22, 2012 15:18
Show Gist options
  • Save aldente39/2158969 to your computer and use it in GitHub Desktop.
Save aldente39/2158969 to your computer and use it in GitHub Desktop.
ls with color
#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