Add-Type -A System.IO.Compression.FileSystem
[IO.Compression.ZipFile]::CreateFromDirectory('foo', 'foo.zip')
[IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar')
I found the code to create and extract .zip files via PowerShell from this answer, but because of my low reputation I cannot ask a question as a comment on that answer.
- Creating - How to overwrite an existing .zip file without user interaction?
- Extracting - How to overwrite existing files and folders without user interaction? (Preferably like robocopys
mir
function).