Forum / Remote Desktop Manager - PowerShell Repository

How can I load the RDM snappin in external powershell session?

  • Create an Issue
  • Cancel

How can I load the RDM snappin in external powershell session?
I need to be able to run a script under the Windows Task Scheduler and need to be able to load the snappin via code.
Any help is appreciated.
Stu

Clock4 yrs

Hello,

These lines load the RDM PowerShell snap-in in an external PowerShell script :

$RDMPath = "C:\Program Files (x86)\Devolutions\Remote Desktop Manager"
$RDMVersion = "11.1.0"

set-alias installutil "$([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())installutil.exe"
installutil "$RDMPath\RemoteDesktopManager.PowerShell.dll"
if ( (Get-PSSnapin -Name Remote.Desktop.Manager.$RDMVersion -ErrorAction SilentlyContinue) -eq $null ) { Add-PsSnapin Remote.Desktop.Manager.$RDMVersion }


Be sure to set the correct version number for RDM and also the correct path!

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs

Do we need to run the script each time we load RDM? Thanks.

Clock4 yrs

Thanks!

Clock4 yrs

Hello,

@Shiam, you have to run this script every time you run a PowerShell script outside RDM.

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs