Work in progress patch to create mRemoteNG connection files from PowerShell.
PS C:\> Import-Module -Name ($env:USERPROFILE + '\Documents\WindowsPowerShell\Modules\PSmRemoteNG\20.1.23.1059\PSmRemoteNG.psm1') -Verbose -Force
PS C:\> Import-MRNGRootNode -Path ($env:USERPROFILE + '\AppData\Roaming\mRemoteNG\confCons.xml')
Using Salt to deploy mRemoteNG.
user@salt-master:~$ sudo salt 'windows-machine' state.apply app-mremoteng
Sample state.sls
to call via salt:
#!mako|yaml
# mRemoteNG is a tabbed, multi-protocol, remote connections manager.
<% mremoteng_version = '1.77.2' %>
<% mremoteng_installer = 'C:\mRemoteNG v' + str(mremoteng_version) + '.msi' %>
<% mremoteng_source = 'https://github.com/mRemoteNG/mRemoteNG/releases/download/2022.01.07-1.77.2-nb/2022.01.07-1.77.2-nb.mRemoteNG-Installer.msi' %>
<% mremoteng_source_hash = '3FB53F974993197865B73126694B2BE37174007854A57C37381032C49E4E7DE8' %>
app-mremoteng-download:
file.managed:
- name: ${mremoteng_installer}
- source: ${mremoteng_source}
- source_hash: ${mremoteng_source_hash}
- makedirs: True
app-mremoteng-install:
cmd.run:
- name: 'C:\Windows\System32\msiexec.exe /package "${mremoteng_installer}" /passive /norestart'
- shell: powershell
- unless:
- '$AvailableVersion = [System.Version]"${mremoteng_version}" ; $CurrentVersion = [System.Version](Get-Item "c:\Program Files\mRemoteNG\mRemoteNG.exe").VersionInfo.FileVersion ; if ($AvailableVersion -gt $CurrentVersion) { Write-Error -Message "Newer mRemoteNG is available, installing..." }'
# PS C:\> $Deserializer.Deserialize($XmlString)
#
# MethodInvocationException: Exception calling "Deserialize" with "1" argument(s):
# "Could not load file or assembly 'BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942'.
# The system cannot find the file specified."
#
app-mremoteng-config:
file.managed:
- name: 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\BouncyCastle.Crypto\v1.9.0.0__0e99375e54769942\BouncyCastle.Crypto.dll'
- source: 'c:\Program Files\mRemoteNG\BouncyCastle.Crypto.dll'