I am writing a powershell script to create a zip folder on the remote machine of size 47 gb in the C:\ drive . The folder is also in C:\ drive . The C:\ drive have 66gb free space but still gives me error of "not enough memory resources" to create the zip so I tried to create the zip from C:\ to H:. My H:\ drive have 121 gb free but still is giving me error. I am attaching the screenshot of both errors.
$curentDirectory = $PSScriptRoot
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Write-Output "Script Current Directory is:"$curentDirectory
Write-Output "Reading Configuration From :"$curentDirectory"/config.xml"
$myData = [xml](Get-Content $curentDirectory"/config.xml" -ErrorAction Stop)
$machineName = $myData.'tangoEnvironment'.VM01.machineName
$machineDrive= $myData.'tangoEnvironment'.VM01.machineDrive
$remoteUser = $myData.'tangoEnvironment'.VM01.remoteUser
$remotePassword = $myData.'tangoEnvironment'.VM01.remotePassword
$userCred = New-Object Management.Automation.PSCredential($remoteUser, (convertto-
securestring $remotePassword -asplaintext -force))
Invoke-Command -ComputerName $machineName -Credential $userCred -ScriptBlock {
Write-Host ""
Write-Host "Response from Jump Server($env:COMPUTERNAME) ..."
# Rest of service
Compress-Archive -Path C:/Humera -DestinationPath H:"/Humera.zip"
}
cmd /c pause