title: Azure Storage - Uploading .zip file with PowerShell
body: <p>I have an Azure DevOps build pipeline that includes a PowerShell task. That task uploads a file to Azure Storage. At this time, I've created the following script:</p>
  
  <p><strong>PowerShell Script</strong></p>
  
  <pre><code>New-Item -ItemType directory -Path ./test
  New-Item -Path ./test -Name "file.txt" -ItemType "file" -Value "hello world"
  
  Compress-Archive -Path ./test/* -DestinationPath ./test.zip
  
  $azureStorageKey = "&lt;MyAccessKey&gt;"
  $storage_context = New-AzureStorageContext -StorageAccountName "mystorageaccount" -StorageAccountKey "$azureStorageKey"
  Set-AzureStorageBlobContent -Context $storage_context -Container "mycontainer" -File "./test.zip" -Blob "temp/test.zip" -Force
  </code></pre>
  
  <p>This script successfully runs on my local machine and in Azure DevOps. While I can <em>see</em> the <code>test.zip</code> file in my Azure Storage account, it seems corrupted.</p>
  
  <p>From the Azure Portal, I choose "Download" from the <code>test.zip</code> file blob context menu. The <code>test.zip</code> file gets downloaded to my machine. I then try to unzip the archive file by selecting "Expand All..." from the File Explorer on Windows. When I do that, I receive an error that says:</p>
  
  <pre><code>Windows cannot open the folder.
  
  The Compressed (zipped) Folder 'C:\Users\me\Downloads\test.zip' is invalid.
  </code></pre>
  
  <p>Why does this archive file seem corrupt? It's fine on my local machine. But, when I download it from the Azure Portal, I can't extract the contents of the archive. What am I missing? Thank you for your help.</p>