问题描述
我在 powershell 中遇到了 Compress-Archive 命令的问题.似乎一旦它从中提取的目录的文件大小超过 20 GB 左右,它就会返回错误.
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
如果 from 的文件夹大小小于 20GB,则此命令可以正常工作.如果它的大小大于 20GB,我会收到以下错误
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 : 找不到路径Z:\To\test.Zip",因为它没有存在.
Test-Path : 指定的通配符模式无效:
Test-Path : The specified wildcard character pattern is not valid:
是否有限制,只是未在 Microsoft 网站上注明?
Is there a limit on this that is just not notated on Microsoft site?
注意:我使用的是 Windows 10
Note: I am on windows 10
推荐答案
我建议你使用 powershell 并调用一个性能更好的程序来压缩,比如 7zip、winrar 或其他.使用大文件可能会获得更好的结果.
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 :
这篇关于powershell compress-archive 文件大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!