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

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -