title: How to duplicate objects in variable with different variable names for PowerShell
body: <p>I would like to create a duplicate of same objects in different variable names.
  The object I required is archive files from dotnetzip. </p>
  
  <p>The following code is the full implementation: </p>
  
  <pre><code>   [System.Reflection.Assembly]::LoadFrom($zipFileDirectory + "Ionic.Zip.dll")
      $zipfile = [Ionic.Zip.ZipFile]::Read($zipfilename) 
  
      foreach ($file in $zipfile)
      {    
          $strSearchItem = [string]$file.FileName
          $strSearchItem = $strSearchItem.TrimEnd("/") 
          $newfile = $file.PSObject.Copy() 
  
      for ($i = 0; $i -lt $newfile.Count; $i++)
      {
  
          if ($strSearchItem -like $searchFolderName + "/*")
          {
             $newFile[$i].FileName = $newFile[$i].FileName.Replace($searchFolderName + "/", "")
             $newFile[$i].Extract($fileDestination, [Ionic.Zip.ExtractExistingFileAction]::OverWriteSilently) 
  
          }
  
      }
     } 
  
      $zipfile.Dispose() 
  </code></pre>
  
  <p>For this purpose I need to be able to copy $file as separate entity from $zipfile, or at least retain the original default value for $file (making it read-only doesnt seemed viable). Is there any workaround for this matter? 
  Thanks in advance. </p>