pipeline - Alias for "| foreach { "$_" }" in PowerShell -



pipeline - Alias for "| foreach { "$_" }" in PowerShell -

i utilize next code emulate unix "find" behavior:

ls directory -recurse -include pattern | foreach { "$_" }

in fact, there couple of other commands i'd append | foreach { "$_" } to. i'm trying find way create easier type. tried stuff this:

function xfind { ls $args | foreach { "$_" } }

and invoked so:

xfind directory -recurse -include pattern

but seemed wrong thing...

consider utilize -name switch of get-childitem (aka ls, dir):

ls directory -recurse -include pattern -name

this way native, clean, , effective.

powershell pipeline

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -