dir –a:d

In cmd, listing files based on attributes was simple: only directories dir /a:d only files (no directories) dir /a:-d only hidden files dir /a:h In PowerShell, it’s not so easy: only directories dir | ? { $_.PSIsContainer } only files (no directories) dir | ? { !$_.PSIsContainer } only hidden files dir -force | ? { $_.Attributes –band [IO.FileAttributes]::Hidden } We have had requests to cover the Read More...

Read the complete post at http://blogs.msdn.com/powershell/archive/2009/03/13/dir-a-d.aspx


Posted Mar 13 2009, 01:39 PM by Windows PowerShell Blog
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.