Powershell (RDM Cmdlet) window does not respect the command coloring on Windows 10

Powershell (RDM Cmdlet) window does not respect the command coloring on Windows 10

avatar

This is RDM Enterprise 12.0.2 on Windows 10 (build 1607)

The built in tool labelled Powershell (RDM Cmdlet) does not "obey" the powershell coloring. The powershell session I created does obey the coloring, while the toolbar version does not.

I took 2 screenshots showing the difference from the same RDM.. the PS_Embedded shows my created session, while the PS_RDMEmbedded shows the Powershell (RDM Cmdlet) window..

And the $host.ui.rawui seems to show that they should be using the correct coloration
PS_Embedded:

ForegroundColor : DarkYellow
BackgroundColor : DarkMagenta
CursorPosition : 0,1
WindowPosition : 0,0
CursorSize : 25
BufferSize : 164,3000
WindowSize : 164,59
MaxWindowSize : 164,71
MaxPhysicalWindowSize : 192,71
KeyAvailable : False
WindowTitle : Windows PowerShell

And the PS_RDMEmbedded:
ForegroundColor : DarkYellow
BackgroundColor : DarkMagenta
CursorPosition : 0,3
WindowPosition : 0,0
CursorSize : 25
BufferSize : 192,4000
WindowSize : 164,71
MaxWindowSize : 192,71
MaxPhysicalWindowSize : 192,71
KeyAvailable : False
WindowTitle : Windows PowerShell

Thank you,

David F.

PS_Embedded.png

PS_RDMEmbedded.png

All Comments (4)

avatar

Hi,

Do you use Remote Desktop Manager 64 bits or 32 bits? When you use the 64 bits version, the PowerShell used in PowerShell (RDM CMDLET) is the 64-bit (x64) Powershell executable located in "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" otherwise it's the 32-bit (x86) PowerShell executable located in "%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"

Which PowerShell do you open in your command line?

Best regards,

Olivier Désalliers

avatar

I'm using the 32bit version of RDM..
My PS window is the 64bit version (didn't even think about that originally)..

I turned off the checkbox for 64bit, and now it doesn't follow the coloring.. (reverified both)..

Is there an option to make it follow the coloring on 32bit?

if not, then I have my answer..

Thanks!

David F.

avatar

Hi,

The syntax coloring is a PowerShell feature, not a RDM one. The syntax coloring use PsReadLine.

If you write PsReadLineOption in PowerShell 64 bits, you will be able to to see that it exists and see that, for example, a variable is green because of that property: "VariableForegroundColor : Green". When you write PsReadLineOption in the 32 bits version, it will return an error if you don't have PsReadLine installed in it.

For more information about PsReadLine and how to install it in PowerShell 32bits you can read these articles:

https://blogs.technet.microsoft.com/heyscriptingguy/2014/06/16/the-search-for-a-better-powershell-console-experience/
http://www.hanselman.com/blog/TowardsABetterConsolePSReadLineForPowerShellCommandLineEditing.aspx

Best regards,

Olivier Désalliers

avatar

Thank you.. I had no idea that Microsoft included in in x64 powershell, but not x86 powershell.

I really appreciate the help!

David F.