You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a PowerShell script to download and extract an archive. It's a .tar.bz2 and when I use Expand-7Zip for the first time, it only decompresses it, leaving a .tar file. But when I try to extract it, I get an error message saying it's an invalid package. That is weird because when I double-click on it, 7Zip GUI opens it normally 🤔. This is the whole script:
$ErrorActionPreference="Stop"functionExpand-Tar($TarFile,$Destination) {
if (-not (Get-CommandExpand-7Zip-ErrorAction Ignore)) {
Install-Package-Scope CurrentUser -Force 7Zip4PowerShell >$null
}
Expand-7Zip$TarFile$Destination
}
Write-Output"Downloading libraries..."Invoke-WebRequest http://fna.flibitijibibo.com/archive/fnalibs.tar.bz2 -OutFile libs.tar.bz2
New-Item-ItemType directory -Name libs
Write-Output"Exctracting..."Expand-Tar-TarFile libs.tar.bz2
Expand-Tar-TarFile libs.tar -Destination libs
Remove-Item libs.tar.bz2
Write-Output"Libs have been extracted to the libs/ directory. Copy files for your platform to the debug folder."
And this is the error:
Expand-7Zip : Invalid archive: open/read error! Is it encrypted and a wrong password was provided?
If your archive is an exotic one, it is possible that SevenZipSharp has no signature for its format and thus decided it is TAR by mistake.
At C:\Users\Michal Grňo\Documents\GitHub\mff-totem\getlibs.ps1:14 char:5
+ Expand-7Zip $TarFile $Destination
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (SevenZip4PowerS...ip+ExpandWorker:ExpandWorker) [Expand-7Zip], SevenZipArchiveException
+ FullyQualifiedErrorId : err01,SevenZip4PowerShell.Expand7Zip
As I said, extracting with GUI (v18.01) works fine...
The text was updated successfully, but these errors were encountered:
I'm going to guess that it's the same filename as you see in the GUI except it ends in .tar? For example if you have file.tar.bz2 and inside that is document.txt, it comes out with document.txt.tar? If so your problem is similar to what I had with the openSUSE images.
I'm using a PowerShell script to download and extract an archive. It's a
.tar.bz2
and when I useExpand-7Zip
for the first time, it only decompresses it, leaving a.tar
file. But when I try to extract it, I get an error message saying it's an invalid package. That is weird because when I double-click on it, 7Zip GUI opens it normally 🤔. This is the whole script:And this is the error:
As I said, extracting with GUI (v18.01) works fine...
The text was updated successfully, but these errors were encountered: