title: Delete a file from zip files in powershell 4
body: <p>I have a function that is working fine. It extract zip file into a destination folder. If the destination folder contains files, it overwrite with the new extract files.Now I wanted to delete/remove one file (bigfile.txt) with a size of 12G before extracting the zip file. How will I do that. Can anyone help me please ? below is the function.  Thank you</p>
  
  <pre><code>function Unzip($zipfile, $outdir)
  {
  Add-Type -AssemblyName System.IO.Compression.FileSystem
  $archive = [System.IO.Compression.ZipFile]::OpenRead($zipfile)
  foreach ($entry in $archive.Entries)
  {
  $entryTargetFilePath = [System.IO.Path]::Combine($outdir, $entry.FullName)
  $entryDir = [System.IO.Path]::GetDirectoryName($entryTargetFilePath)
  #Ensure the directory of the archive entry exists
  if(!(Test-Path $entryDir )){
  New-Item -ItemType Directory -Path $entryDir | Out-Null
  }
  
  #If the entry is not a directory entry, then extract entry
  if(!$entryTargetFilePath.EndsWith("\")){
  [System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $entryTargetFilePath, $true);
  }
  
  Unzip -zipfile "c:\temp\filezip_1.zip" -outdir "c:\folder_1\extracted_files"
  Unzip -zipfile "c:\temp\filezip_2.zip" -outdir "c:\folder_2\extracted_files"e
  </code></pre>