Mark Key
Mark Key

Reputation: 3

PowerShell formatting custom objects with the format.ps1.xml file

I have created a custom object and created a generic view in the ps1.xml file and it formats great, I would like to add color to the output. How would I go about adding color to the output in the ps1.xml file. For example my output is a simple table in which one column has a status output for cloud servers. I would like the output to display white for active, red for stopped, yellow for rebooting etc. I am guessing it would take a but I have not yet found any examples or articles detailing the use of it for color in the ps1.xml file.

Any help would be appreciated.

Upvotes: 0

Views: 1160

Answers (1)

BartekB
BartekB

Reputation: 8650

No colors in ps1xml files in v3. You can:

I hope v4 will finally get it. Conditionally colored output would really help to spot issues, so I guess it make perfect sense to have. Not there yet though...

Upvotes: 1

Related Questions