samedi 18 avril 2015

How do you enable powershell to interpret ansi color codes when using get-content to echo to the screen?

I have a log file that contains ansi color codes around various text. I'm echoing it to the console using the powershell language command:



get-content logfile.log -wait


so I can see the latest log changes. However, all the ansi color codes show up as text characters like:



Esc[90mEsc[39m


How do you get them intepreted as color codes in the powershell window?


Not being very familiar with the powershell language yet, is there a powershell command or encoding option to handle this? I've read various powershell docs but haven't found anything in them re these ansi codes.


Aucun commentaire:

Enregistrer un commentaire