O R G A N I C / F E R T I L I Z E R: powershell: retrieving directories in the current path

Jun 10, 2013

powershell: retrieving directories in the current path

hard -- obscure if you don't know the calls, aren't familiar with programming (basically, me)

[io.directory]::GetDirectories($(get-location))


medium -- not so bad when you know what to look for

get-childitem | where-object { $_.mode -eq "D----" }
get-childitem | where-object { $_.PSISContainer -eq $true }
get-childitem | where-object { $_.Attributes -eq 'Directory' }


easy -- at least there's no bracketing or positional parameters to worry about

get-childitem | where-object psiscontainer -eq $true


easiest -- near parity with cmd shell, provided you use shortcuts

get-childitem -directory