Is there any way to retain the Powershell command coloring scheme after execution of the command in the Console Pane.
And is there a way to color the output column-headers separately.
None of the themes I browsed or could find online achieve this.
Is there any way to retain the Powershell command coloring scheme after execution of the command in the Console Pane.
And is there a way to color the output column-headers separately.
None of the themes I browsed or could find online achieve this.
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.
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