1

I am having a issue with the Compress-Archive Command in powershell. It seems once the file size of the directory it pulls from is over 20 or so GB it returns an error.

Compress-Archive -Path Z:\from\* -CompressionLevel Optimal -DestinationPath Z:\To\test.zip

If the folder size of from is under 20GB in size, this command works fine. If it is greater than 20GB in size I get the following error

Remove-Item : Cannot find path 'Z:\To\test.Zip' because it does not exist.

Test-Path : The specified wildcard character pattern is not valid:

Is there a limit on this that is just not notated on Microsoft site?

Note: I am on windows 10

alroc
  • 27,574
  • 6
  • 51
  • 97
Stephen Hale
  • 25
  • 1
  • 1
  • 5
  • `Compress-Archive` does indeed have a [size limit](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?view=powershell-7#description) – Andrew Dibble Nov 09 '20 at 10:53
  • You can find the PowerShell solution using `IO.Compression` [here](https://stackoverflow.com/questions/72607926/how-do-i-compress-files-using-powershell-that-are-over-2-gb) – Santiago Squarzon Oct 19 '22 at 22:21

1 Answers1

3

I suggest you to use powershell and call a program that is more performant to zip like 7zip, winrar or others. You could probably achive a better result with big file.

You could refer to this post for alternatives :

How to create a zip archive with PowerShell?

Community
  • 1
  • 1
jboo
  • 364
  • 6
  • 14