title: Powershell ParentContainsErrorRecordException on shell namespace
body: <p>I'm trying to write an unzip powershell script, but I'm running into issues with the <code>$shell.NameSpace()</code> function.</p>
  
  <pre><code>function unzip ($sourceFile, $destination){
      $shell = new-object -com shell.application
      $zip = $shell.NameSpace($sourceFile)
      foreach($item in $zip.items()){
          $shell.Namespace($destination).copyhere($item) #Error here
      }
  }
  
  unzip "$PWD\folder.zip" $PWD
  </code></pre>
  
  <p>When I run this, I get an error on the second <code>$shell.NameSpace()</code> call. </p>
  
  <pre><code>You cannot call a method on a null-valued expression.
  At C:\scriptDir\unzipScript.ps1:9 char:6
  +         $shell.NameSpace($destination).copyhere($item)
  +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : InvokeMethodOnNull
  </code></pre>
  
  <p>What I dont understand is why this is failing on the <em>second</em> call. Clearly <code>PWD</code> exists and is a directory based on the first parameter.</p>