What modules to import to run powershell commands in external script?

What modules to import to run powershell commands in external script?

avatar

Hello,

I have a .ps1 file that has commands I need to run, which works perfectly fine when called via the embedded powershell. However, I have a need to run this script every hour and was thinking of doing so with a scheduled task, but the script fails to execute the RDM specific commands which I assume is because it is outside of the powershell embedded into the RDM UI.

So my question is: Which modules do I need to import or is there support in RDM itself to run such a script on a schedule?

I am using version 12.0.8.0

The commands I need to be able to run are:









Thanks for the help!

All Comments (7)

avatar

did you import the RDM module? You have to import it by the dll name directly..

David F.

avatar

David,
That's exactly my question. In the rdm folder there are dozens of dll files, which ones do I need to import to run the 4 commands listed?

avatar

figured it out, add:
Import-Module "${env:ProgramFiles(x86)}\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShellModule.dll

source: https://blog.devolutions.net/2016/09/new-remote-desktop-manager-powershell-module.html

avatar

Hello Patrick,

Thank you for your feedback.

Glad that is now working.

Best regards,

Jeff Dagenais

avatar

Jeff D.

Is there any chance you guys will convert or put in some sort of pointer to make it easier to just do something like 'Import-Module RemoteDesktopManager'

David F.

avatar

Hello,

Indeed, information is missing in our online help on the subject. We will had the proper information in our online help.

Thank you for your feedback.

Best regards,

Jeff Dagenais

avatar

Hi David,

It's already possible to do this if you have at least RDM (Beta) 12.4.0.0:

Import-Module RemoteDesktopManager.PowerShellModule
Best regards,

Olivier Désalliers