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

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

avatar

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

All Comments (4)

avatar

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

avatar

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

avatar

Thanks!

avatar

Hello,

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

Best regards,

Érica Poirier