r/PowerShell • u/Minimum_Comedian694 • Feb 09 '26
Question ASCII text file in PowerShell
My color-coded ASCII text file displays correctly in Windows Command Prompt, but it doesn't render properly in PowerShell. How can I fix it? Thanks!
5
Upvotes
7
u/cjcox4 Feb 09 '26
Things like "color support" are a function of the "terminal". With that said, using the new-ish Windows Terminal as a good ANSI terminal is recommended.
Would think there would be no problems then.
1
u/Minimum_Comedian694 Feb 10 '26
I'm a beginner in CLI coding. This is my code in notepad++: https://imgur.com/a/3SkHtQX
This is how it is displayed in Windows Command Prompt and PowerShell: https://imgur.com/a/4U1VIoR
2
u/BlackV Feb 09 '26
We can't see your code, could a bunch of reasons
Likely incorrectly formatting strings
1
u/Conscious_Support176 Feb 09 '26
I’m guessing you are taking about ascii text with ANSI escape sequences.
This might help. You want to get the console/terminal to behave as an xterm.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_ansi_terminals?view=powershell-7.5
1
u/420GB Feb 09 '26
The terminal renders the colors, not the shell, so whether it's CMD or PowerShell is irrelevant. You must be using different terminals for each of them if there is a difference - or a broken color scheme