How to unzip a file in Powershell?

前端 未结 9 2144
清歌不尽
清歌不尽 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:09

    Hey Its working for me..

    $shell = New-Object -ComObject shell.application
    $zip = $shell.NameSpace("put ur zip file path here")
    foreach ($item in $zip.items()) {
      $shell.Namespace("destination where files need to unzip").CopyHere($item)
    }
    

提交回复
热议问题