Color output in PowerShell

google-music-scripts
#1

Hello,

I am having a weird problem when I execute the program in PowerShell. When I run it in console everything is fine, but once I run it from script the output changes colors of black on black. The text is still there and I can recover it by copy/paste. I tried to look at different settings, Powershell themes but nothing helped. I dug into the source code with my limited Python ability and could see it is using LogZero but did not find any way how to identify where does this problem come from.

Would you be able to help me to identify if the colors are changed by the logging system inside the function or by any other way?

Thank you for your help.

Kind regards,

Radek

#2

I have no idea how that would happen in PowerShell. I can’t reproduce it here. I don’t use PowerShell aside from when I test something on it, so you’re kinda on your own figuring this out.

#3

Hello,

thank you for your answer. It helped me to know that it was not configurable in your library.

I actually just worked it out and it is weird, I would not believe it. If I have your command in a function that returns a value (result) and then I read the value, then it happens that the colors are changed. if I just call the function without reading the result then the colors are unaffected. I would have no idea something like this might happen, I tried to move the code around to confirm what I have written and could replicate it 100%… I am happy with the outcome, had to find a workaround but I do not mind as long as I know how to avoid it.

Kind regards,

Radek