Select-String in ZIP
I have a script to search a string in a log file and export it. The problem is that I need to decompress the files inside the ZIp and they are many.

Is there a way to look for it within the zip file without decompression?

Get-Content "E:\Logs\access*.log" | ? { ($_ | Select-String "GET /WEB01/index.jsp?")} | Out-File E:\tmp\web01.csv -Append

Thanks!!!

June 27th, 2015 10:58am

No but some ZIP utilities can do that.  I would look into the enterprise version of PkZip.

Free Windows Admin Tool Kit Click here and download it now
June 27th, 2015 12:35pm

Hi JRV

But through powersehll I can perform that operation?

Thanks

June 27th, 2015 12:41pm

No you can't.
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2015 12:47pm

Short answer: using a 3rd party dll or command-line application it IS possible!

Powershell doesn't allow you to... but 7zip may be more useful than PkZip. It can't give you data from directly in a zip, but it CAN give you ONE file from a zip and save it into the temp, and it can be run from the command-line with a command-line application, and it can be run directly using the

June 28th, 2015 3:17am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics