title: How to expand ZIP archive using PowerShell (UTF-8 filenames)
body: <p>My zip archive has a single file:</p>
  
  <pre class="lang-none prettyprint-override"><code>Père-Noël.txt
  </code></pre>
  
  <p>The zip expands nicely with Windows File Explorer, 7-Zip or any other tool I've tried. But I cannot figure out how to do it from PowerShell. Obviously I've tried <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/expand-archive?view=powershell-5.1" rel="nofollow noreferrer">Expand-Archive</a> but it cannot handle the file name and garbles it into <code>PŠre-N”el.txt</code>. Note: The problem isn't specifically with this example, but indeed with any file name which uses characters outside of the ASCII-127 range. Or so it seems.</p>
  
  <p>Any solution which uses PowerShell and which doesn't rely on an external tool - whose presence cannot be guaranteed - will be accepted. Windows 10 is the platform. I cannot do system-level changes and cannot rely on users of the script having any specific global setting on their system. It has to be a solution <em>within</em> the script.</p>
  
  <p>Is there another way, besides <code>Expand-Archive</code> ? Or is there a setting in PowerShell which will magically do the trick? </p>
  
  <h3>Steps to reproduce:</h3>
  
  <p>On your Windows 10 host:</p>
  
  <ol>
  <li><p>Create an empty file named <code>Père-Noël.txt</code>.  </p></li>
  <li><p>ZIP the file using Windows Explorer ("Compressed Folders" feature) into an ZIP archive of your choice, say <code>myarchive.zip</code>. </p></li>
  <li><p>Delete the <code>Père-Noël.txt</code> file.</p></li>
  <li><p>Now try to unpack the <code>myarchive.zip</code> using PowerShell. This operation should create the file <code>Père-Noël.txt</code> again.</p></li>
  </ol>
  
  <h3>Compressing using PowerShell Compress-Archive cmdlet</h3>
  
  <p>True, if the ZIP was originally created using <code>Compress-Archive</code> cmdlet then it actually works as intended when decompressing using <code>Expand-Archive</code>. So you can say that PowerShell is compatible with itself. It is just not compatible with Windows Explorer ZIPs.</p>