Task Agent CLI - run from remote machine

I am trying to automate our copy from Live process. As part of that i need to stop and start the task agent on the source and target environments. I hope to use the task agent CLI (TaskAgentServiceConfiguration.exe) to do this in a powershell script.

Problem is the 2 environments are on different servers so for one of them I will need to execute a remote command in the powershell. I seem to be having trouble with permissions as the command is not successful. Below is the line in the powershell script that call the remote command.

Invoke-Command -ComputerName Beacon -ScriptBlock { & 'C:\Program Files (x86)\Common Files\Epicor Software\Application Server Manager Extensions\3.2.100\TaskAgentConfiguration\TaskAgentServiceConfiguration.exe' -Action=StopAgent -configfile="C:\Epicor Admin\TaskAgentConfig$E10System.xml" -Logfile='C:\Epicor Admin\Log.txt' } -Credential TMTROV\Brett

I tried the -Credentials to see if that helped but no luck.

Logfile has this:

TaskAgentCL Information: 0 : Processing Started. Configuration file = C:\Epicor Admin\TaskAgentConfigLive.xml, Action = StopAgent.

when run locally the log file has this and the task agent starts/stops as expected.

TaskAgentCL Information: 0 : Processing Started. Configuration file = C:\Epicor Admin\TaskAgentConfigBeacon.xml, Action = StartAgent.
TaskAgentCL Information: 0 : Performing action: StartAgent on agent Beacon.
TaskAgentCL Information: 0 : Processing Ended.

Anyone got any ideas??


PS this