In bash, the equivalent would be

for x in `ls *.zip` do ; unzip $x ; done

How do I do this in Windows Powershell.

Update As Johannes Rössel pointed out this is a bad example (unzip *.zip) but what I'm after is the "foreachness" of it.

link|improve this question

75% accept rate
feedback

1 Answer

up vote 4 down vote accepted
ls *.zip | foreach-object { unzip $_ }
link|improve this answer
2  
Unfortunate example: unzip *.zip easily works. – Joey Aug 12 '09 at 13:10
2  
Canonical powershell uses gci or Get-ChildItem. – Jay Bazuzi Mar 11 '11 at 3:35
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.