PShell Variables are colored brown (like strings) instead of Red Orange

Charles Chung 21 Reputation points
2021-09-27T20:29:35.443+00:00

Hello All,

First time posting here. We recently created a new server as a repository for all our PowerShell scripts and Scheduled tasks.

When I opened Powershell ISE for the first time and opened a script, I noticed that all the variables are the same color (brown) as string text.

I checked and confirmed the color was set correctly to "Orange Red" when navigating to ...Tools -> Options -> Color and Fonts Tab -> Console Tokens -> Variable

The sample also shows the variables colored correctly, but the script continues to show all the variables as brown.

I thought that maybe there was a quote that wasn't closed somewhere, but that doesn't seem to be the case.

I even opened a new ps1 file and confirmed this finding by making random variables.

Does anyone have any suggestions as to what could be causing this issue?135692-2021-09-27-16-27-27-remote-desktop-manager-usac-po.png135702-2021-09-27-16-26-56-remote-desktop-manager-usac-po.png

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,451 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,506 Reputation points
    2021-09-28T09:56:46.227+00:00

    Hello @Charles Chung

    Unfortunately Microsoft doesn't support Powershell ISE anymore. Replacement is Visual Studio Code with the Powershell Extension.

    Source: https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/whats-new/what-s-new-in-the-powershell-50-ise?view=powershell-7.1#:~:text=There%20is%20no%20support%20for,Code%20with%20the%20PowerShell%20Extension.

    Hope this helps with your query,

    ----------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 45,671 Reputation points
    2021-09-27T21:33:10.167+00:00

    Shouldn't you be using the Script Pane and not the Console Pane choice?

    Also, the Powershell ISE support was ended some time ago. You'll be better off using something else. Some folks like NotePad++. I use VS Code. I used to use Visual Studio. All of those are good choices -- plus you get multiple language support, and even stuff like CSV editors!

    0 comments No comments