have Powershell get-childitem return files only

Posted by Frank Schwieterman on Super User See other posts from Super User or by Frank Schwieterman
Published on 2010-06-09T17:13:59Z Indexed on 2010/06/09 17:23 UTC
Read the original article Hit count: 281

Filed under:

I'd like to use get-childitem recursively, but only have it return files not directories. The best solution I have just doesn't seem natural:

gci . *.* -rec | where { $_.GetType().Name -eq "FileInfo" }

© Super User or respective owner

Related posts about powershell