0

I've programmed in the past and I remember having a terminal that would change the colors of words depending on their function (different color for variables, different color if I imported something etc). How is this accomplished in general? I installed Pygments but it seems that just does it for text files.

Any help would be greatly appreciated

1
  • You're probably looking for PSReadLine. Commented Mar 25, 2016 at 17:21

1 Answer 1

1

Powershell ISE with Powershell Version 4.0+ Includes some good coloring features for interactive scripting.

screenshot

Powershell v2 ships with Windows 7, v4 can be downloaded and ISE is on the machine already. Current powershell version is v5, but beware-- some software like Server 2008 R2 running Exchange 2010 is built on v2, and a lot of the cmdlets won't work for v3-v5 without PS-Sessions.

In case you were curious about coloring output to the host, you can just do

Write-Host "my string" -fore 'color' -back 'color'

If you want a fully-fledged powershell IDE, you can purchase SAPIEN Powershell Studio which also wraps scripts in Windows Forms, can build MSI packages and similar things. If you're a hard core powershell kind of guy, it may be worth your time if making GUI powershell applications.

Sign up to request clarification or add additional context in comments.

2 Comments

Powershell 5 has syntax highlighting for the regular shell (and of course ISE) out of the box.
@bluuf That's because it ships with PSReadLine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.