unzip file using 7z in powershell

前端 未结 4 2039
长情又很酷
长情又很酷 2020-12-20 18:02

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 -         


        
4条回答
  •  隐瞒了意图╮
    2020-12-20 18:25

    Aliases are not meant for that, they are meant to proxy other commands, not commands + parameters.

    To achieve what you want you would need to use a functions:

    function sz($args) {
        Start-Process "$env:ProgramFiles\7-Zip\7z.exe" -ArgumentList $args
    }
    

提交回复
热议问题