unzip file using 7z in powershell

Deepanshu Kalra picture Deepanshu Kalra · Mar 24, 2017 · Viewed 23.9k times · Source

What is the command to unzip a file using 7z in powershell?

set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
sz x  $zipfilePath $destinationUnzipPath -aoa -r;

The command works fine but it says no files to process, everything is Ok rather than unzipping the file?

Answer

Deepanshu Kalra picture Deepanshu Kalra · Mar 27, 2017

This finally worked for me sz x -o$destinationUnzipPath $zipfilePath -r ;