Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

recursively find zip files and copy to another location

$
0
0

Hi

Can anyone explain how I would do a recursive search of a folder and subfolders and find files that contains *****_pass.zip or ******_fail.zip and then move them. I tried to do this 

gci C:\temp\data\output | Where-Object { $_.name -contains "_pass.zip"} | foreach-object { copy-item c:\temp\data\output\$_. C:\temp\data\output\again }

all i get is returned to a prompt. I need it to only look for those zip files with pass/fail.zip at the end as there are other folders


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>