I am trying to execute an exe on a remote computer using invoke-command. Executing the exe on the remote machine after logging into the machine using remote desktop takes 1GB of memory and executes to completion after a minute. Whereas when I execute the same exe using Invoke-Command on the same machine, the process returns an OutOfMemoryException and ends suddenly. My invoke command is as simple as Invoke-Command -Session $someSessionVariable -ScriptBlock {Invoke-Expression "abc.exe --arg arg"} -AsJob
.
Am I missing something regarding the restrictions on remote invocation?
Thanks in Advance.
iex
for calling a native program? PowerShell is a shell. Executing commands is what it does. – Amphibolyiex
– Hexarchyiex
ist just a layer above all that problems, at least how I understand it. You just add a layer of indirection while solving no problem at all. – Amphiboly