I want to exclude all directories from my search in PowerShell. Both FileInfo
and DirectoryInfo
contain Attributtes
property that seems to be exactly what I want, but I wasn't able to find out how to filter based on it. Both
ls | ? { $_.Attributes -ne 'Direcory' }
ls | ? { $_.Attributes -notcontains 'Direcory' }
didn't work. How can I do this?