PowerShell Open Source - Compress-Archive not working.

Created on 10 Jan 2017  路  4Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

Compress-Archive -Path c:Temp -DestinationPath c:TempLogTempzip.zip

or

Compress-Archive -Path c:Temp -DestinationPath c:TempTempzip.zip

Expected behavior

To create Tempzip.zip file on folder c:TempLog

Actual behavior

Error message comes up:

Exception calling "Write" with "3" argument(s): "Stream was too long."
At C:program filespowershell6.0.0.14ModulesMicrosoft.PowerShell.ArchiveMicrosoft.PowerShell.Archive.psm1:819
char:29

  • ... $destStream.Write($buffer, 0, $numberOfBytesRead)
  • ~~~~~~~~~~~~~

    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException

    • FullyQualifiedErrorId : IOException

Environment data

Windows 10 Pro聽Insider Preview Build 14986

PS C:\Program Files\PowerShell\6.0.0.14> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
GitCommitId                    v6.0.0-alpha.14
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
CLRVersion
SerializationVersion           1.1.0.1
BuildVersion                   3.0.0.0
PSEdition                      Core

compressarchiveissue_2017-01-10_12-16-51

Resolution-External

Most helpful comment

@MaximoTrinidad Please specify what is a size of the source data?
According to the documentation, limit is 2 Gb.

All 4 comments

By the way,聽it does work in Linux Ubuntu 16.04.1
compressarchivegood

@MaximoTrinidad Please specify what is a size of the source data?
According to the documentation, limit is 2 Gb.

Ah!! Thanks @iSazonov
Sorry! I should聽have checked for the size limitation.
Closed the incident.

Greatly Appreciated,
Maximo Trinidad

@MaximoTrinidad the 2GB limit is an unfortunately limitation of the .Net api being used. There is an open issue for Zip64 support: https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/19

Was this page helpful?
0 / 5 - 0 ratings