Issues with script after upgrade to ps 7 and Devolutions.PowerShell module

Issues with script after upgrade to ps 7 and Devolutions.PowerShell module

avatar

Hi!

As the subject say our rdm scripts does not work anymore after upgrade of rdm to 2023.2.12.0 64-bit. Script is written to use ps 5. Script is collecting data from vmware environments using powercli and rdm sessions. Now when we are forced to use ps 7 and Devolutions.PowerShell module. The rdm cmdlets in the script does not work anymore.

One idea I had was to update the script to only use ps 7 for rdm cmdlets, ex: pwsh -command {Get-RDMSession}. This works fine but I can't get it to work when I want a varible as input, ex: pwsh -command {$connstring | Get-RDMSessionUserName}. Maybe there is a way to get this to work? Varible seems to be empty when command runs.

What I am trying is to combine ps 5 and ps 7 in the same script. But I have a feeling that maybe it is not how you should do it..? If I run the entire script with ps 7 I guess I will run into other issues like powercli. This script is part of a bigger function and I try to make as little change as possible. Are we forced to use ps 7 with Devolutions.PowerShell module in rdm version 2023.2.12.0 64-bit? I have never used ps 7 before and it is strange that it is a separate installation instead of an upgrade of ps 5. Not easy to get old script to work in both ps installations..

Best Regards Magnus

All Comments (1)

avatar

Hello Magnus,

Since at least version 12 of PowerCLI, PowerShell 7 is supported. If you can run at least that version, we would strongly recommend running everything directly on PS7, it will minimize issues with the Devolutions.PowerShell module, since it does only support PS 7, and cannot be used with PS 5.1.

The cmdlets that were in the previous version of the module will also work in the new module, and new ones are added regularly.

PowerShell 5.1 has not been updated in a few years, Microsoft only maintains PowerShell 7.2-7.3-7.4 now. For more information - https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3

Best regards,

Richard Boisvert