How would I go about registering an external WCF service (automatically) using a batch file for example (powershell maybe)?
Register it where? In the AOT? I haven't tested scripting the process of adding a external reference using X++, but one place to start is here:
This is the type you will be using when adding that treeNode in the AOT.
Let us know if it works. :-)