<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Powershell function: Unzip all files in a folder - Coding forum				            </title>
            <link>https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/</link>
            <description>PureSourceCode Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Sat, 11 Jul 2026 20:59:39 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Answer to: Powershell function: Unzip all files in a folder</title>
                        <link>https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/#post-113</link>
                        <pubDate>Mon, 28 Feb 2022 11:41:31 +0000</pubDate>
                        <description><![CDATA[Extract zip files to the same location with same folder name (removed .zip)
gci -Recurse -Filter *.zip |ForEach-Object {$n=($_.Fullname.trimend(&#039;.zip&#039;)); Expand-Archive -Path $_.Fullname -D...]]></description>
                        <content:encoded><![CDATA[<p><strong>Extract zip files to the same location with same folder name (removed .zip)</strong></p>
<pre contenteditable="false">gci -Recurse -Filter *.zip |ForEach-Object {$n=($_.Fullname.trimend('.zip')); Expand-Archive -Path $_.Fullname -DestinationPath $n -Force}</pre>
<p><strong>Extract zip files to different location with same name (extracted folder name will contains .zip)</strong></p>
<pre contenteditable="false">gci -Filter *.zip |ForEach-Object {Expand-Archive -Path $_ -DestinationPath C:\Temp\$_ -Force}</pre>
<p><strong>Extract zip files to different folder location, this will extract the zip files including sub folders in destination)</strong></p>
<pre contenteditable="false">PS C:\Temp\tt&gt; gci -Recurse -Filter *.zip |ForEach-Object {$n=($_.Fullname.trim('C:\Temp .zip')); Expand-Archive -Path $_.Fullname -DestinationPath C:\TempT\$n -Force}</pre>]]></content:encoded>
						                            <category domain="https://puresourcecode.com/forum/coding-forum/">Coding forum</category>                        <dc:creator>Enrico</dc:creator>
                        <guid isPermaLink="true">https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/#post-113</guid>
                    </item>
				                    <item>
                        <title>Answer to: Powershell function: Unzip all files in a folder</title>
                        <link>https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/#post-112</link>
                        <pubDate>Mon, 28 Feb 2022 11:40:06 +0000</pubDate>
                        <description><![CDATA[This should work.
Get-ChildItem &#039;path to folder&#039; -Filter *.zip | Expand-Archive -DestinationPath &#039;path to extract&#039; -Force
Also, this one it is a bit complex but it works
PARAM (
    [str...]]></description>
                        <content:encoded><![CDATA[<p><span>This should work.</span></p>
<pre contenteditable="false">Get-ChildItem 'path to folder' -Filter *.zip | Expand-Archive -DestinationPath 'path to extract' -Force</pre>
<p>Also, this one it is a bit complex but it works</p>
<pre contenteditable="false">PARAM (
     $ZipFilesPath = "X:\Somepath\Full\Of\Zipfiles",
     $UnzipPath = "X:\Somepath\to\extract\to"
)
 
$Shell = New-Object -com Shell.Application
$Location = $Shell.NameSpace($UnzipPath)
 
$ZipFiles = Get-Childitem $ZipFilesPath -Recurse -Include *.ZIP
 
$progress = 1
foreach ($ZipFile in $ZipFiles) {
    Write-Progress -Activity "Unzipping to $($UnzipPath)" -PercentComplete (($progress / ($ZipFiles.Count + 1)) * 100) -CurrentOperation $ZipFile.FullName -Status "File $($Progress) of $($ZipFiles.Count)"
    $ZipFolder = $Shell.NameSpace($ZipFile.fullname)
 
 
    $Location.Copyhere($ZipFolder.items(), 1040) # 1040 - No msgboxes to the user - http://msdn.microsoft.com/en-us/library/bb787866%28VS.85%29.aspx
    $progress++
}</pre>]]></content:encoded>
						                            <category domain="https://puresourcecode.com/forum/coding-forum/">Coding forum</category>                        <dc:creator>Enrico</dc:creator>
                        <guid isPermaLink="true">https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/#post-112</guid>
                    </item>
				                    <item>
                        <title>Powershell function: Unzip all files in a folder</title>
                        <link>https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/#post-111</link>
                        <pubDate>Mon, 28 Feb 2022 11:37:17 +0000</pubDate>
                        <description><![CDATA[I have a folder &quot;Zipped&quot; which contains 100s of .zip files
I want to unzip all zip-files in this folder to &quot;\\zipped\Unzipped&quot; folder.It seems expand-archive cmdlet only support one file at...]]></description>
                        <content:encoded><![CDATA[<p>I have a folder "Zipped" which contains 100s of .zip files</p>
<p>I want to unzip all zip-files in this folder to "\\zipped\Unzipped" folder.<br /><br />It seems expand-archive cmdlet only support one file at a time.<br />So do you need to create an array with all filenames and then create a loop to unzip all files?</p>]]></content:encoded>
						                            <category domain="https://puresourcecode.com/forum/coding-forum/">Coding forum</category>                        <dc:creator>Enrico</dc:creator>
                        <guid isPermaLink="true">https://puresourcecode.com/forum/coding-forum/powershell-function-unzip-all-files-in-a-folder/#post-111</guid>
                    </item>
							        </channel>
        </rss>
		