So I have a script that is supposed to take a backup of a database and the compress it into a zip file. I am using 7Zip and am getting the following:
Error: "Can't Allocate Required Memory"
when I try to compress the backup. The backup is roughly 2.3GBs and the remote machine that I am trying to run the script on has 3GB of memory available when I look at Task Manger. Also, when I open Powershell on the remote machine and run the code
set-alias sz "$env:C:\Temp\7-Zip\7z.exe"
sz a -t7z $zipfile $backup
that way it works just fine.
Here is my code:
Invoke-Command -Session $s -ScriptBlock {set-alias sz "$env:C:\Temp\7-Zip\7z.exe"}
Write-Host "Compressing Database and creating Zip file...."
Invoke-Command -Session $s -ScriptBlock {sz a -t7z $zipfile $backup}
Write-Host "Completed Compressing Database and creating Zip file!"
I have looked at a 7Zip forum post and have tried to decrease the dictionary size, but it still doesn't work. Any ideas or suggestions on how to fix this issue would be appreciated.
Edit: The remote machine's Powershell version is 2.0 and is 64-bit.