Simple PowerShell cmdlet to call Consul API and generate confCons.xml file for mRemoteNG
consulUri
- Consul addressconnectionFile
- path where confCons.xml should be savedsshUsername
- username for ssh connection
You can execute this cmdlet every time you start mRemoteNG. Just edit / create the shortcut and add this or run it in command line or powershell console:
powershell -NoProfile -Command "kill -Name mRemoteNG -Force -EA SilentlyContinue" ; New-mRemoteNGConnectionFile -consulUri {{ Consul Address }} -connectionFile {{ path for confCons.xml file }} -sshUsername {{ ssh username }} ; {{ path for mRemoteNG.exe file }} /c:"{{ path for confCons.xml file }}"
for example:
powershell -NoProfile -Command "kill -Name mRemoteNG -Force -EA SilentlyContinue" ; New-mRemoteNGConnectionFile -consulUri http://consul.mydomain:8500/v1/catalog/nodes -connectionFile C:\Program Files\mRemoteNG\confCons.xml -sshUsername my-ssh-user ; C:\Program Files\mRemoteNG\mRemoteNG.exe /c:"C:\Program Files\mRemoteNG\confCons.xml"