Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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