I've tried a number of different ways to do this, they all result in the same error. Here is one set of commands:
$s = New-PSsession -ComputerName ServerA
$job = Invoke-Command -Session $s -Scriptblock { Start-Process -FilePath
"C:\Scripts\ArchiveEventLogs\ver4.5\7za.exe" -ArgumentList "a",
"C:\Scripts\Eventlogs.bak\ServerA-20101111.7z", "C:\Scripts\Eventlogs.bak\*.evt*",
"-mx7", "-oC:\Scripts\Eventlogs.bak", "-wC:\Scripts\Eventlogs.bak", "-t7z" -Wait }
-AsJob
Get-Job | Wait-Job
Receive-Job Job$
The output I get is this:
7-Zip (A) 9.17 beta Copyright (c) 1999-2010 Igor Pavlov 2010-10-04
Scanning
Creating archive C:\Scripts\Eventlogs.bak\ServerA-20101111.7z
ERROR: Can't allocate required memory!
How can I get past that error???
I should point out, if I run the Scriptblock directly on ServerA without the remoting, it works. Thanks for any help!