Read-Archive Error

Topics: User Forum
Aug 26, 2009 at 7:13 PM

I am trying to use Read-Archive and receive this error:

Read-Archive : Error reading index 0

The commandline I am using is:

Read-Archive -Path foo_bar.gz
Read-Archive : Error reading index 0
At line:1 char:13
+ Read-Archive  <<<< -Path foo_bar.gz

Has anyone seen this before?

Aug 26, 2009 at 8:17 PM

GZipped files only contain one file; -Index is intended for container archives like TAR and ZIP etc. It should probably give a better error than that, yeah, but drop the parameter entirely and it should work fine.


Aug 26, 2009 at 9:37 PM

I am not specifically using a -Index switch. The only parameter I am specifying is -Path per my original post. I dont see -Index as a switch in the Syntax either:

    Read-Archive [-Path] <String[]> [[-Format] <ArchiveFormat>] [-IncludeDirect
    ories] [-ShowProgress] [<CommonParameters>]

    Read-Archive -InputObject <PSObject> [-IncludeDirectories] [-ShowProgress]

    Read-Archive [-LiteralPath] <String[]> [-IncludeDirectories] [-ShowProgress
    ] [<CommonParameters>]

Sep 12, 2009 at 4:09 PM

Any chance you could provide a sample GZ file that doesn't work?



Apr 25, 2010 at 10:03 PM

Same problem here..

> Read-Archive -Verbose -Path .\planet-100414.osm.bz2
VERBOSE: 1 item(s) in archive.
Read-Archive : Error reading index 0
At line:1 char:13
+ Read-Archive <<<<  -Verbose -Path .\planet-100414.osm.bz2
    + CategoryInfo          : ReadError: (:) [Read-Archive], ArgumentException
    + FullyQualifiedErrorId : ArchiveReadFail,Pscx.Commands.IO.Compression.ReadArchiveCommand

downloaded file planet-100414.osm.bz2and ran md5 check from