News for hackers. Stuff that matters.
Re:PowerShell is open sourced and is available on Linux by ygra on Thursday August 18, 2016 @03:06PM (#12315430)
ls is an alias for Get-ChildItem. However, grep is the native command in this case. While such things work to some extent, it has the problem of turning your objects into plain strings. Effectively the same as if you had run

    (ls | % Name) -match '_'
The fact that the file's name is its default string conversion can be pretty annoying when dealing with results, e.g. from gci -recurse where it's quiet important to retain the path to the file. So, careful with such things. On Stack Overflow I tend to scold people who reduce PowerShell objects to strings without good reason ;-)

There are no comments on this comment yet.