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.
DateTime=2019-02-14T08:55:53.6394011Z

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.
DateTime=2019-02-14T09:04:20.4457228Z
TaskAgentCL Information: 0 : Performing action: StartAgent on agent Beacon.
DateTime=2019-02-14T09:04:20.5067244Z
TaskAgentCL Information: 0 : Processing Ended.
DateTime=2019-02-14T09:04:20.6497359Z

Anyone got any ideas??

Brett

PS this 10.2.100.24