Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell Extract Zip Files

Posted on September 11, 2015May 8, 2018 By David Kittell
function Expand-ZipFile([string]$File, [string]$Destination) #The targets to run.
{
    $Shell = new-object -com shell.application

    # Get the name of the Zip file
    $Zip = $Shell.NameSpace($File)

    #Expand/Extract each file from the zip file
    foreach($Item in $Zip.items())
        {
            $Shell.Namespace($Destination).copyhere($Item)
        }
}
Expand-ZipFile –File "C:\file.zip" –Destination "C:\tempfile"

Reference: http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/

Originally Posted on September 11, 2015
Last Updated on May 8, 2018
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell

Post navigation

Previous post
Next post

Related Posts

List All Files In Folder

Posted on September 23, 2015

<?PHP function getDirectory( $path = ‘.’, $level = 0 ){ $ignore = array( ‘cgi-bin’, ‘.’, ‘..’ ); // Directories to ignore when listing output. Many hosts // will deny PHP access to the cgi-bin. $dh = @opendir( $path ); // Open the directory to the handle $dh while( false !==…

Read More

PowerShell – Rename Pictures to Image Taken

Posted on November 20, 2015December 17, 2023

# If you haven’t already done so you will need to run this to be able to execute PowerShell scripts # You will need to run PowerShell as administrator to run this script set-executionpolicy remotesigned <# .SYNOPSIS Renames pictures. .DESCRIPTION The Rename-Pictures cmdlet to rename pictures to a format where…

Read More

Run SQL Statement

Posted on August 1, 2013October 26, 2015

protected string sRunSQLStmnt(string sSQL) { string sReturn = ""; //Declare the connection object SqlConnection sqlConn = new SqlConnection(connString); int numberOfRecords = 0; try { //Make the connection sqlConn.Open(); //Declare the Command SqlCommand sqlCommand = new SqlCommand(sSQL + " SELECT @@ROWCOUNT AS DELETED;", sqlConn); //Execute the query numberOfRecords = sqlCommand.ExecuteNonQuery(); }…

Read More

Code

Top Posts & Pages

  • Bleaching Wool using Hydrogen Peroxide
  • Front Page
  • PowerShell - Rename Pictures to Image Taken
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • Bleaching Wool using Hydrogen Peroxide
  • PowerShell - Rename Pictures to Image Taken
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - IPv4 Range
  • PowerShell - Install .NET 4.5.2
©2025 David Kittell | WordPress Theme by SuperbThemes