PowerShell 7.0

avatar

The RDM Module doesn't work with PowerShell 7.0

PS C:\> Import-Module "C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShellModule.psd1"
PS C:\> Get-RDMDataSource
WARNING: System.NullReferenceException: Object reference not set to an instance of an object.
at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.LoadConnections(BaseConnectionDataSource dataSource, ConnectionEngine currentEngine)
at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.RefreshConnections()
at RemoteDesktopManager.PowerShellModule.BaseCommand.BeginProcessing()
Get-RDMDataSource: Cannot retrieve the dynamic parameters for the cmdlet. Object reference not set to an instance of an object.
PS C:\>

Has anyone got it working? Is it supported

All Comments (9)

avatar

Hello,

The RDM PowerShell is not yet supported on PowerShell version 7.0. I get the same behaviour as what you get. Let me check with the engineering team and will get back to you once I will get some information about it.

Best regards,

Érica Poirier

avatar

I was able to get it working using the switch:

Import-Module -UseWindowsPowerShell "C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShellModule.psd1"

See here:
https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-70?view=powershell-7#:~:text=7%2Dpreview%20directory.-,Improved%20backwards%20compatibility%20with%20Windows%20PowerShell,with%20existing%20Windows%20PowerShell%20modules.&text=For%20more%20information%20on%20which,see%20the%20Module%20Compatibility%20Table

For Windows, a new switch parameter UseWindowsPowerShell is added to Import-Module. This switch creates a proxy module in PowerShell 7 that uses a local Windows PowerShell process to implicitly run any cmdlets contained in that module. For more information on Import-Module.

But that only helps for dataset retrieval. After I failed:

PS C:\> Set-RDMCurrentDataSource -DataSource $RDMDS
Set-RDMCurrentDataSource: Cannot bind parameter 'DataSource'. Cannot convert the "RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataSource" value of type "Deserialized.RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataSource" to type "RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataSource".

avatar

Hello,

Thank you for the information on how to properly load the RDM PowerShell module in PowerShell 7.

I get the exact same error message. An engineer will have a look on this and we will keep you posted.

Best regards,

Érica Poirier

avatar

Just another update - I was able to retrieve a password using the Get-RDMSession command (I didn't need to Set the DataSource).

Also the Update-RDMUI command worked. I guess some commands work, others don't.

avatar

Hello,

The RDM PowerShell module will load the data source that is normally loaded in RDM. That is why you don't have to set the data source if you have only one data source configured in RDM. With multiple data sources, just set the appropriate data source as the default one in File - Data Sources.

Best regards,

Érica Poirier

avatar

Hello,

For your information about PowerShell 7, as you are already aware of it, RDM isn't ready for it and the engineers will analyze that possibility. At first sight, this maybe a bit complicated as RDM uses very specific parts of the .Net framework. We will keep you posted on this one.

Best regards,

Érica Poirier

avatar

As I also wrote in https://forum.devolutions.net/topics/34170/make-powershell-module-compatible-with-powershell-core:

Hi support!

having PowerShell core support would be great - I just checked, if I could use the module natively on a Mac (There is no module on the Mac in the installed application). This does not seem to work although I got PowerShell natively installed on my MacBook Pro. Please also consider supporting PowerShell on MacOS and Linux.

Thanks and with kind regards,

Achim Hentschel

avatar

Hi, support

are your engineers still looking into the possibility to port the module to PowerShell 7? Is there any news regarding implementation?
Would be great to get an update.

Thx
Detlef

avatar

Hello Detlef,

Good timing on your question, the module for RDM 2021.2 supports PowerShell 7. You can download the beta here: https://forum.devolutions.net/topics/36090/remote-desktop-manager-20212-beta

Best regards,

Richard Boisvert