Get-Directory Function

24 03 2008

In the olden days (i.e. when I used CMD.EXE), I often did “dir *.” to quickly get a list of the directories in the current path. PowerShell doesn’t work this way (which is good because it would be unexpected), so I had to make a replacement.

function Get-Directory { ls $Args | ? { $_.PSIsContainer } }

The alias which makes most sense to me for this function is “lsd”. What, that acronym is already in use? :)


Actions

Information

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>