PowerShell Set-RDMSessionProperty not working for Sub properties

PowerShell Set-RDMSessionProperty not working for Sub properties

avatar

Dear Devolutions,


It seems we can't set sub properties using the powershell cmd-lets. Below is an example of what's going wrong.


PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSessionProperty -ID $myitem.ID -Property RDP.ScreenSizingMode
FitToWindow
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Set-RDMSessionProperty -ID $myitem.ID -Property RDP.ScreenSizingMode -value "FitToWindow"
WARNING: Path or property not found. Value not set.


Kind regards

All Comments (4)

avatar

Hi,

You need to write the path of the property.

In your case it is:

[color=rgb(69, 69, 69)][font="Helvetica Neue"]Get-RDMSessionProperty -ID $myitem.ID -Path "RDP" -Property "ScreenSizingMode" [/font][/color]
[color=rgb(69, 69, 69)][font="Helvetica Neue"]Set-RDMSessionProperty -ID $myitem.ID -Path "RDP" -Property ScreenSizingMode -value "FitToWindow"[/font][/color]
You can also achieve the same thing this way:
$myitem.RDP.ScreenSizingMode
$myitem.RDP.ScreenSizingMode = "FitToWindow"
Best regards,

Olivier Désalliers

avatar

Dear Olivier,


Works perfect this way!


Thanks

avatar

Dear Olivier,


Still seems to be an issue... Changing it from PowerShell doesn't affect anything. Also powershell shows the wrong value.


ScreenSizingMode set in RDM Application to SizeWindow
XML View
<ScreenSizingMode>FitToWindow</ScreenSizingMode>
...
<ID>a6400da7-2b95-4509-9ced-3221dc5c8729</ID>
Powershell View
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> write-host $item.ID => $item.RDP.ScreenSizingMode
a6400da7-2b95-4509-9ced-3221dc5c8729 => FitToWindow


ScreenSizingMode set in RDM Application to Smart Reconnect
XML View
<ScreenSizingMode>AutoScale</ScreenSizingMode>
...
<ID>a6400da7-2b95-4509-9ced-3221dc5c8729</ID>
Powershell View
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> write-host $item.ID => $item.RDP.ScreenSizingMode
a6400da7-2b95-4509-9ced-3221dc5c8729 => FitToWindow

avatar

Hi,

You need to use Set-RDMSession to save the object in your data source.

$myitem.RDP.ScreenSizingMode = "FitToWindow"
Set-RDMSession -Session $myitem -Refresh
Best regards,

Olivier Désalliers