Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PowerShell Script

Posted on 2014-03-23
4
Medium Priority
?
56 Views
Last Modified: 2015-09-20
I am looking for power shell script to automate the unzipping of a .zip file.
Let me know what is the script which is required to do this.
0
Comment
Question by:SrikantRajeev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 2000 total points
ID: 39949663
function Expand-ZIPFile($file, $destination) {
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items()) {
        $shell.Namespace($destination).copyhere($item)
    }
}

Open in new window

Use as Expand-ZIPFile –File “C:\archive.zip” –Destination “C:\temp”

Code taken from here: http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/

If you need a more robust function, with error checking, see here: http://gallery.technet.microsoft.com/scriptcenter/PowerShell-Function-to-727d6200

HTH,
Dan
0
 
LVL 1

Author Comment

by:SrikantRajeev
ID: 39964497
I will check this out.
0
 
LVL 1

Author Comment

by:SrikantRajeev
ID: 40985926
I've requested that this question be closed as follows:

Accepted answer: 0 points for SrikantRajeev's comment #a39964497

for the following reason:

Thanks
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 40985927
I think the OP meant to accept my comment.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Simple Linear Regression

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question