1

I work a lot in command line with app with sends a lot of information in response in json. I found that sometimes it is not easy to find where the response starts and ends and where is the command of this response response in Console2 and CMD

I tried Console2, CMD, PowerShell but didn't find any options to configure command and response colors. Do you know such apps? Ideally it would be very nice to find app with configurable syntax colors (i.e. set colors for JSON in response)

Cheburek
  • 2,103
  • 21
  • 32

1 Answers1

1

Yes, you can do it in powershell, but not that easy. It depends on what you actually doing. Let's say you are using powershell simply as console to run some command line tool, like:

SendRequest "url" "param" "param"

Powershell will just printout whatever is returned. What you can do is to write a small PowerShell wrapper that will catch output of this command and add some colors to it, like this:

param($url, $param1, $param2)
$response = SendRequest $url $param1 $param2
Write-Host $response.Property1 -ForegroundColor Cyan
Write-Host $response.JSON -ForegroundColor Red

This way you call:

.\execSendRequest.ps1 "url" "param" "param"

And it will show you response in color. Similarly you can do some more processing for each property and print out your JSON response in different colors.

Andrey Marchuk
  • 13,301
  • 2
  • 36
  • 52