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
  • 26,843
  • 6
  • 49
  • 94
Stephen Hale
  • 25
  • 1
  • 1
  • 5
  • `Compress-Archive` does indeed have a [size limit](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?view=powershell-7#description) – Andrew Dibble Nov 09 '20 at 10:53

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
  • 334
  • 6
  • 13