Forum / Remote Desktop Manager - Feature Request

Powershell tab

  • Create an Issue
  • Cancel

Hey Devolutions developers!

Can you please fix so that the tabs for powershell gets a proper window width?

Not like this

no


But like this

yes


smile

no.png
yes.png
Clock5 yrs

Just a hint (play aroung with the values):

 $Host.UI.RawUI.BufferSize = new-object System.Management.Automation.Host.Size 227,9999 
$Host.UI.RawUI.WindowSize = new-object System.Management.Automation.Host.Size 227,93

might be added to your $Profile (<User Dir>\\WindowsPowerShell\Microsoft.PowerShell_profile.ps1)

Clock5 yrs

I have added it to the script that is executed yes, but i would like Remote Desktop Mananger to fix it automatically.
It's a problem if you're using another computer/resolution and it would be better if Remote desktop manager could set the values dynamically based on the computers screen resolution smile

Clock5 yrs

I do it also this way (getting my favourite Size when loading my function-library).
Or even better on the size of the session window, so the Scroll Bars stay visible even when resizing the nav-tree-element....

Clock5 yrs

Hi all,

v9.2 (available here) now has a few new PowerShell session features (v9.2 change history available here)

  • Added a PowerShell setting to show debug
  • Added a setting in the PowerShell session to force window resize (buffer & window)
  • Added option to load RDM CmdLet Snap-in in a PowerShell session
  • Fixed issue where RDM CmdLet Snap-in didn't load in 64-bit mode
3 12 2014 8 19 08 AM

This is currently only available in the PowerShell session not the tools type sessions. It's all I was able to squeeze into the latest build.

How does it work? We inject the two lines of code (suggested by Peter Cermak)

$Host.UI.RawUI.BufferSize = new-object System.Management.Automation.Host.Size PowerShellBufferSizeCols, PowerShellBufferSizeRows
$Host.UI.RawUI.WindowSize = new-object System.Management.Automation.Host.Size PowerShellWindowSizeCols, PowerShellWindowSizeRows
The variables PowerShellBufferSizeCols, PowerShellBufferSizeRows, PowerShellWindowSizeCols & PowerShellWindowSizeRows are in fact system options with default values of 250, 4000, 250 & 84 respectively. They can be modified via the RemoteDesktopManager.cfg file by adding the appropriate xml tags example:
<PowerShellBufferSizeCols>180</PowerShellBufferSizeCols>


The resize code has a small issue where sometimes the UI doesn't resize the window to fit, even though the buffer has been set properly, for the time being simply resize the tree view and all is good, happens about 15% of the time, I'm still investigating.


If you use the "Load RDM CmdLet (Snap-in) option, the session may be forced to start with elevated privileges. This will only happen the first time since the snap-in must be registered prior to it being loaded.


Please let me know what you think.


Regards,

Stefane Lavergne

signaturesignature

3-12-2014 8-19-08 AM.png
Clock5 yrs

Thank you very much, very helpful

Just a small glitch when is start from "Tools - Powershell cmdlet", that means a session doesn't show this but just resizes.
i also have a horizontal scrollbar, which vanishes, when i resize the undocked powershell window to a width of 2040 pixels. So the PowerShellWindowSizeCols is slightly larger than the actual screen resolution (1920).

Using this settings works for my layout

<PowerShellWindowSizeCols>192</PowerShellWindowSizeCols>
<PowerShellBufferSizeCols>192</PowerShellBufferSizeCols>




Maybe you could somehow calulate the sizes from the actual workspace (without Nav-tree, toolbars,...) but if not, i could live with it also.

========================================
Resize PowerShell buffer and window size
Exception setting "WindowSize": "Window cannot be wider than 240.
Parameter name: value.Width
Actual value was 250."
At line:4 char:1
+ $Host.UI.RawUI.WindowSize = new-object System.Management.Automation.Host.Size 25 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( : ) [], SetValueInvocationException
+ FullyQualifiedErrorId : ExceptionWhenSetting

Loading RDM CmdLet (Snap-in)
========================================


Capture 2014 03 18 08 46 48

Capture_2014-03-18_08-46-48.png
Clock5 yrs

Peter Cermak wrote:

Just a small glitch when is start from "Tools - Powershell cmdlet", that means a session doesn't show this but just resizes.
i also have a horizontal scrollbar, which vanishes, when i resize the undocked powershell window to a width of 2040 pixels. So the PowerShellWindowSizeCols is slightly larger than the actual screen resolution (1920).

I will change the default to be 192 for both and (eventually) add them to the File -> Options UI so that you don't need to change them in the file.

Peter Cermak wrote:

Maybe you could somehow calulate the sizes from the actual workspace (without Nav-tree, toolbars,...) but if not, i could live with it also.

Calculating the size based on the screen resolution is a difficult one. The screen is in pixel width and the window is specified in column width. I would need to take into account font and font size. Not sure if I can even get those values dynamically.


Thank you for the feedback.

Regards,

Stefane Lavergne

signaturesignature

Clock5 yrs