How to unzip a file in Powershell?

前端 未结 9 2143
清歌不尽
清歌不尽 2020-11-29 17:07

I have a .zip file and need to unpack its entire content using Powershell. I\'m doing this but it doesn\'t seem to work:

$shell = New-Object -Co         


        
9条回答
  •  执笔经年
    2020-11-29 17:26

    In PowerShell v5.1 this is slightly different compared to v5. According to MS documentation, it has to have a -Path parameter to specify the archive file path.

    Expand-Archive -Path Draft.Zip -DestinationPath C:\Reference
    

    Or else, this can be an actual path:

    Expand-Archive -Path c:\Download\Draft.Zip -DestinationPath C:\Reference
    

    Expand-Archive Doc

提交回复
热议问题