Powershell 压缩存档正在抛出';System.OutOfMemoryException';

Powershell 压缩存档正在抛出';System.OutOfMemoryException';,powershell,Powershell,在PowerShell命令下远程运行以将文件夹压缩为zip格式时,获取“System.OutOfMemoryException” PS>Compress Archive-Path\\myserver1\Backup\8159-DestinationPath\\myserver1\Backup\8159.zip 在myserver1机器上直接运行如下所示的相同命令时,使用“3”参数调用“Write”时出现异常:“流太长。” PS>Compress Archive-Path E:\Backup\8

在PowerShell命令下远程运行以将文件夹压缩为zip格式时,获取“System.OutOfMemoryException”

PS>Compress Archive-Path\\myserver1\Backup\8159-DestinationPath\\myserver1\Backup\8159.zip
在myserver1机器上直接运行如下所示的相同命令时,使用“3”参数调用“Write”时出现异常:“流太长。”

PS>Compress Archive-Path E:\Backup\8159-DestinationPath E:\Backup\8159.zip
我也在下面进行了验证

Get-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB
有人能帮我吗

提前感谢…

如中所述,Compress Archive cmdlet依赖Microsoft.NET API来压缩文件

它声明“因此,最大文件大小为2GB。这是基础API的限制。”

如果要压缩的数据超过该限制,则会出现此错误

也许你最好使用7Zip。
您可以在PSGallery中找到一个模块。

此后我们再也没有收到您的消息。。如果你觉得我的答案解决了你的问题,请考虑通过点击来接受。✓ 在左边。看见这将帮助其他有类似问题的人更容易地找到它。
WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   MaxMemoryPerShellMB                            2147483647
Get-Item WSMan:\localhost\Plugin\Microsoft.PowerShell\Quotas\MaxMemoryPerShellMB
WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin\microsoft.powershell\Quotas

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   MaxMemoryPerShellMB                            2147483647