Question

Is there any way to retain the Powershell command coloring scheme after execution of the command in the Console Pane.

enter image description here

And is there a way to color the output column-headers separately.

None of the themes I browsed or could find online achieve this.

Was it helpful?

Solution 2

The Output Colorizer VSC extension does it for the Output stream. I wish it could colorize the terminal output too. https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer

@uruloki

OTHER TIPS

Try the following:

Get-Disk | Select -property * | ft -AutoSize -Wrap | Out-String -stream | %{if($_ | Select-String 'Style' -NotMatch){Write-Host $_ -f Yellow}else{Write-Host $_}}

This passes your output to a string. The -stream operator makes each line into a separate string, and you then check each string for something in your header ('Style'). If it checks, the string gets written out with the color formatting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top