I want to download a folder using a powershell script, but I can't upload folders, so i decided to upload a .zip file.
The problem is that I want to extract the folder from the .zip file using a batch-file.
In older PowerShell versions:
Add-Type -AssemblyName System.IO.Compression.FileSystem
Please note that you got to have .NET 4.5+ installed and it will NOT overwrite existing files (will throw an error if file exists).
In PowerShell v5+ you could simply use:
Expand-Archive C:\file.zip -DestinationPath C:\output
You can use relative paths in here as well.
Expand-archive is very basic. I'm not above using the command line version of 7zip, like for extracting specific folders. All you need is 7z.exe and 7z.dll.