title: 'Invoke-Expression' dropping double quote
body: <p>I have a directory structure with ZIP files in it, and I'd like to extract them with a script.</p>
  
  <p>My script so far:</p>
  
  <pre><code>$7zexe = "c:\bin\7za.exe"
  $arg = ""
  Get-ChildItem -Recurse -Include *.zip |
  ForEach-Object { $argout = $_.Directory.Name
    $arg = " e `"$_`" -o`"$argout`""
    $cmdline = $7zexe, $arg -join ""
    $cmdline
    Invoke-Expression -command  "$cmdline "
  }
  </code></pre>
  
  <p>But I get the following error</p>
  
  <pre><code>c:\bin\7za.exe e "E:\tmp\the folder\the sub folder\my_big_file.zip" -o"the sub folder"
  Invoke-Expression : The string starting:
  At line:1 char:86
   + c:\bin\7za.exe e "E:\tmp\the folder\the sub folder\my_big_file.zip" -o"the sub folder &lt;&lt;&lt;&lt; "
   is missing the terminator: ".
  At x:\mydocs\testscript.ps1:9 char:18
  + Invoke-Expression &lt;&lt;&lt;&lt;  -command  "$cmdline "
      + CategoryInfo          : ParserError: ( :String) [Invoke-Expression], IncompleteParseException
      + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString,Microsoft.PowerShell.Commands.InvokeExpressionCommand
  </code></pre>
  
  <p>Somehow it looks like PowerShell is dropping my closing <code>"</code>.</p>
  
  <p>I tried it with the <code>&amp;</code> operator and I also tried to replace the arguments with an array:</p>
  
  <pre><code>[Array]$arg = "e ", "`"$_`""," -o`"$argout`""
  </code></pre>